1 module.exports = isTypedArray
2 isTypedArray.strict = isStrictTypedArray
3 isTypedArray.loose = isLooseTypedArray
5 var toString = Object.prototype.toString
7 '[object Int8Array]': true
8 , '[object Int16Array]': true
9 , '[object Int32Array]': true
10 , '[object Uint8Array]': true
11 , '[object Uint8ClampedArray]': true
12 , '[object Uint16Array]': true
13 , '[object Uint32Array]': true
14 , '[object Float32Array]': true
15 , '[object Float64Array]': true
18 function isTypedArray(arr) {
20 isStrictTypedArray(arr)
21 || isLooseTypedArray(arr)
25 function isStrictTypedArray(arr) {
27 arr instanceof Int8Array
28 || arr instanceof Int16Array
29 || arr instanceof Int32Array
30 || arr instanceof Uint8Array
31 || arr instanceof Uint8ClampedArray
32 || arr instanceof Uint16Array
33 || arr instanceof Uint32Array
34 || arr instanceof Float32Array
35 || arr instanceof Float64Array
39 function isLooseTypedArray(arr) {
40 return names[toString.call(arr)]