File tree 1 file changed +15
-9
lines changed
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)
3
2
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
3
export function isPlainObject ( value : unknown ) : boolean {
5
4
if ( value === null || typeof value !== "object" ) {
6
5
return false ;
7
6
}
8
7
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 ;
16
22
}
You can’t perform that action at this time.
0 commit comments