Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prepareDataForTransfer (typedArrays) {
const transfers = []
return Transfer(
typedArrays.map(function (typedArray) {
if (typedArray.buffer instanceof SharedArrayBuffer) {
return typedArray
} else {
if (typedArray.byteLength != typedArray.buffer.byteLength) {
// If the typedArray doesn't span the buffer, lets play it safe and make a copy
typedArray = typedArray.slice()
}
transfers.push(typedArray.buffer)
return typedArray
}
}),
transfers
)
}
async decompress(typedArrays) {