File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 1- // From sindresorhus/is-plain-obj
2- // MIT License
1+ // Forked from sindresorhus/is-plain-obj (MIT)
32// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
43export function isPlainObject ( value : unknown ) : boolean {
54 if ( value === null || typeof value !== "object" ) {
65 return false ;
76 }
87 const prototype = Object . getPrototypeOf ( value ) ;
9- return (
10- ( prototype === null ||
11- prototype === Object . prototype ||
12- Object . getPrototypeOf ( prototype ) === null ) &&
13- ! ( Symbol . toStringTag in value ) &&
14- ! ( Symbol . iterator in value )
15- ) ;
8+
9+ if (
10+ prototype !== null &&
11+ prototype !== Object . prototype &&
12+ Object . getPrototypeOf ( prototype ) !== null
13+ ) {
14+ return false ;
15+ }
16+
17+ if ( Symbol . toStringTag in value || Symbol . iterator in value ) {
18+ return false ;
19+ }
20+
21+ return true ;
1622}
You can’t perform that action at this time.
0 commit comments