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

Function convertChunks

lib/internal/streams/iter/utils.js:171–181  ·  view source on GitHub ↗

* Convert an array of chunks (strings or Uint8Arrays) to a Uint8Array[]. * Always returns a fresh copy of the array. * @param {Array } chunks * @returns {Uint8Array[]}

(chunks)

Source from the content-addressed store, hash-verified

169 * @returns {Uint8Array[]}
170 */
171function convertChunks(chunks) {
172 if (allUint8Array(chunks)) {
173 return ArrayPrototypeSlice(chunks);
174 }
175 const len = chunks.length;
176 const result = new Array(len);
177 for (let i = 0; i < len; i++) {
178 result[i] = toUint8Array(chunks[i]);
179 }
180 return result;
181}
182
183/**
184 * Wrap a caught value as an Error, converting non-Error values.

Callers 6

writevSyncMethod · 0.85
writevMethod · 0.85
#writevSlowMethod · 0.85
writevSyncMethod · 0.85
writevMethod · 0.85
writevSyncMethod · 0.85

Calls 2

allUint8ArrayFunction · 0.85
toUint8ArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…