Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current none :
/
proc
/
self
/
root
/
lib
/
nodejs
/
typedarray-to-buffer
/
Or
Select Your none :
Upload File :
New :
File
Dir
//proc/self/root/lib/nodejs/typedarray-to-buffer/index.js
var isTypedArray=require("is-typedarray").strict;module.exports=function(arr){var constructor=Buffer.TYPED_ARRAY_SUPPORT?Buffer._augment:function(arr){return new Buffer(arr)};if(arr instanceof Uint8Array){return constructor(arr)}else if(arr instanceof ArrayBuffer){return constructor(new Uint8Array(arr))}else if(isTypedArray(arr)){return constructor(new Uint8Array(arr.buffer,arr.byteOffset,arr.byteLength))}else{return new Buffer(arr)}};