Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 19fab4a

Browse files
jbedardpetebacondarwin
authored andcommitted
perf(copy): avoid regex in isTypedArray
Closes: #12054
1 parent d129354 commit 19fab4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Angular.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,9 @@ function isPromiseLike(obj) {
678678
}
679679

680680

681-
var TYPED_ARRAY_REGEXP = /^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/;
681+
var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/;
682682
function isTypedArray(value) {
683-
return TYPED_ARRAY_REGEXP.test(toString.call(value));
683+
return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));
684684
}
685685

686686

0 commit comments

Comments
 (0)