MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / CloneAsUint8Array

Function CloneAsUint8Array

examples/io/streams/modules/streams.js:240–243  ·  view source on GitHub ↗
(it)

Source from the content-addressed store, hash-verified

238 new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);
239}
240function CloneAsUint8Array(it) {
241 const buffer = it.buffer.slice(it.byteOffset, it.byteOffset + it.byteLength);
242 return new Uint8Array(buffer);
243}
244
245
246// 4.2 ReadableStream

Callers 2

pullWithDefaultReaderFunction · 0.85
pullWithBYOBReaderFunction · 0.85

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected