MCPcopy Index your code
hub / github.com/nodejs/node / cloneAsUint8Array

Function cloneAsUint8Array

lib/internal/webstreams/util.js:112–119  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

110}
111
112function cloneAsUint8Array(view) {
113 const buffer = ArrayBufferViewGetBuffer(view);
114 const byteOffset = ArrayBufferViewGetByteOffset(view);
115 const byteLength = ArrayBufferViewGetByteLength(view);
116 return new Uint8Array(
117 ArrayBufferPrototypeSlice(buffer, byteOffset, byteOffset + byteLength),
118 );
119}
120
121function canCopyArrayBuffer(toBuffer, toIndex, fromBuffer, fromIndex, count) {
122 return toBuffer !== fromBuffer &&

Callers 1

[kChunk]Function · 0.85

Calls 3

ArrayBufferViewGetBufferFunction · 0.85

Tested by

no test coverage detected