Skip to content

Commit 17fce2a

Browse files
committed
fix: Do not call getter when checking for Symbol.toStringTag in obj
1 parent f63b62b commit 17fce2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module.exports = function typeDetect(obj) {
9494
*/
9595
if (
9696
Array.isArray(obj) &&
97-
(symbolToStringTagExists === false || typeof obj[Symbol.toStringTag] === 'undefined')
97+
(symbolToStringTagExists === false || !(Symbol.toStringTag in obj))
9898
) {
9999
return 'Array';
100100
}

0 commit comments

Comments
 (0)