X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=node_modules%2Fwebsocket%2Fnode_modules%2Ftypedarray-to-buffer%2Fnode_modules%2Fis-typedarray%2Findex.js;fp=node_modules%2Fwebsocket%2Fnode_modules%2Ftypedarray-to-buffer%2Fnode_modules%2Fis-typedarray%2Findex.js;h=58596036cdf15908a729e6547936eef72b2d2e60;hb=0f4e331e6d75c244e978860b62a6e1aed8d446e0;hp=0000000000000000000000000000000000000000;hpb=0cb383f1c0646575a831f4f812cd85c9e24d9a18;p=VSoRC%2F.git diff --git a/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js b/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js new file mode 100644 index 0000000..5859603 --- /dev/null +++ b/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js @@ -0,0 +1,41 @@ +module.exports = isTypedArray +isTypedArray.strict = isStrictTypedArray +isTypedArray.loose = isLooseTypedArray + +var toString = Object.prototype.toString +var names = { + '[object Int8Array]': true + , '[object Int16Array]': true + , '[object Int32Array]': true + , '[object Uint8Array]': true + , '[object Uint8ClampedArray]': true + , '[object Uint16Array]': true + , '[object Uint32Array]': true + , '[object Float32Array]': true + , '[object Float64Array]': true +} + +function isTypedArray(arr) { + return ( + isStrictTypedArray(arr) + || isLooseTypedArray(arr) + ) +} + +function isStrictTypedArray(arr) { + return ( + arr instanceof Int8Array + || arr instanceof Int16Array + || arr instanceof Int32Array + || arr instanceof Uint8Array + || arr instanceof Uint8ClampedArray + || arr instanceof Uint16Array + || arr instanceof Uint32Array + || arr instanceof Float32Array + || arr instanceof Float64Array + ) +} + +function isLooseTypedArray(arr) { + return names[toString.call(arr)] +}