Skip to content

Commit 1f4c1e4

Browse files
committed
Check against Object.prototype
1 parent 2718e2c commit 1f4c1e4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const OBJECT_PROTOTYPE = Object.prototype;
2+
13
export default function isPlainObject(obj: unknown): boolean {
2-
return Object.getPrototypeOf(obj) === Object;
4+
return Object.getPrototypeOf(obj) === OBJECT_PROTOTYPE;
35
}

0 commit comments

Comments
 (0)