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

Function arrayBufferViewToUint8Array

lib/internal/streams/iter/from.js:112–125  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

110}
111
112function arrayBufferViewToUint8Array(chunk) {
113 if (isTypedArray(chunk)) {
114 return new Uint8Array(
115 TypedArrayPrototypeGetBuffer(chunk),
116 TypedArrayPrototypeGetByteOffset(chunk),
117 TypedArrayPrototypeGetByteLength(chunk),
118 );
119 }
120 return new Uint8Array(
121 DataViewPrototypeGetBuffer(chunk),
122 DataViewPrototypeGetByteOffset(chunk),
123 DataViewPrototypeGetByteLength(chunk),
124 );
125}
126
127// =============================================================================
128// Sync Normalization (for fromSync and sync contexts)

Calls 1

isTypedArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…