8000 FIX: support isPlainObj with constructor keys (#1627) · lisongyu/immutable-js@6203e2a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6203e2a

Browse files
authored
FIX: support isPlainObj with constructor keys (immutable-js#1627)
Specifically look for a function instead of any value Closes immutable-js#1623
1 parent 2f8570d commit 6203e2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/isPlainObj.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
export default function isPlainObj(value) {
99
return (
1010
value &&
11-
((value.constructor && value.constructor.name === 'Object') ||
12-
value.constructor === undefined)
11+
(typeof value.constructor !== 'function' ||
12+
value.constructor.name === 'Object')
1313
);
1414
}

0 commit comments

Comments
 (0)
0