Skip to content

Commit 2fac962

Browse files
committed
Fix isTypedArray in environments without Symbol.toStringTag
1 parent f221070 commit 2fac962

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

support/types.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@ function isTypedArray(value) {
6868
if (Uint8ArraySupported && SymbolToStringTagSupported) {
6969
return TypedArrayProto_toStringTag(value) !== undefined;
7070
} else {
71-
return ObjectToString(value) === '[object TypedArray]';
71+
return (
72+
isUint8Array(value) ||
73+
isUint8ClampedArray(value) ||
74+
isUint16Array(value) ||
75+
isUint32Array(value) ||
76+
isInt8Array(value) ||
77+
isInt16Array(value) ||
78+
isInt32Array(value) ||
79+
isFloat32Array(value) ||
80+
isFloat64Array(value) ||
81+
isBigInt64Array(value) ||
82+
isBigUint64Array(value)
83+
);
7284
}
7385
}
7486
exports.isTypedArray = isTypedArray;

0 commit comments

Comments
 (0)