X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fwebsocket%2Fnode_modules%2Ftypedarray-to-buffer%2Findex.js;fp=node_modules%2Fwebsocket%2Fnode_modules%2Ftypedarray-to-buffer%2Findex.js;h=0000000000000000000000000000000000000000;hp=5fa394dd201d2e717aced4aea51c7a9d81c61361;hb=5e96dd57ddd883604e87f62bdddcb111c63a6e1a;hpb=acb5f682a2b75b972710cabd81658f63071324b0 diff --git a/node_modules/websocket/node_modules/typedarray-to-buffer/index.js b/node_modules/websocket/node_modules/typedarray-to-buffer/index.js deleted file mode 100644 index 5fa394d..0000000 --- a/node_modules/websocket/node_modules/typedarray-to-buffer/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Convert a typed array to a Buffer without a copy - * - * Author: Feross Aboukhadijeh - * License: MIT - * - * `npm install typedarray-to-buffer` - */ - -var isTypedArray = require('is-typedarray').strict - -module.exports = function typedarrayToBuffer (arr) { - if (isTypedArray(arr)) { - // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer - var buf = Buffer.from(arr.buffer) - if (arr.byteLength !== arr.buffer.byteLength) { - // Respect the "view", i.e. byteOffset and byteLength, without doing a copy - buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) - } - return buf - } else { - // Pass through all other types to `Buffer.from` - return Buffer.from(arr) - } -}