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 fbd5bd6 commit a56cbafCopy full SHA for a56cbaf
packages/firestore/src/util/input_validation.ts
@@ -282,14 +282,14 @@ function validateType(
282
}
283
284
/**
285
- * Returns true iff it's a non-null object without a custom prototype
+ * Returns true if it's a non-null object without a custom prototype
286
* (i.e. excludes Array, Date, etc.).
287
*/
288
export function isPlainObject(input: AnyJs): boolean {
289
return (
290
typeof input === 'object' &&
291
input !== null &&
292
- Object.getPrototypeOf(input) === Object.prototype
+ (Object.getPrototypeOf(input) === Object.prototype || Object.getPrototypeOf(input) === null)
293
);
294
295
0 commit comments