We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 026b5f2 commit 192abc2Copy full SHA for 192abc2
src/index.ts
@@ -171,3 +171,19 @@ export function memo<T, P extends keyof T>(
171
}
172
return result;
173
174
+
175
+/**
176
+ * Validate if a value is an object
177
+ *
178
+ * @param {object} source
179
+ * @returns {Boolean}
180
+ */
181
+export function isPlainObject(source: Object): boolean {
182
+ const typeofSource: string = typeof source;
183
+ const sourcePrototype: string = Object.prototype.toString.call(source);
184
+ return (
185
+ typeofSource === 'object' &&
186
+ source !== null &&
187
+ sourcePrototype === '[object Object]'
188
+ );
189
+}
0 commit comments