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

Function isUint8ArrayBatch

lib/internal/streams/iter/from.js:178–191  ·  view source on GitHub ↗

* Check if value is already a Uint8Array[] batch (fast path). * @returns {boolean}

(value)

Source from the content-addressed store, hash-verified

176 * @returns {boolean}
177 */
178function isUint8ArrayBatch(value) {
179 if (!ArrayIsArray(value)) return false;
180 const len = value.length;
181 if (len === 0) return true;
182 // Fast path: single-element batch (most common from transforms)
183 if (len === 1) return isUint8Array(value[0]);
184 // Check first and last before iterating all elements
185 if (!isUint8Array(value[0]) || !isUint8Array(value[len - 1])) return false;
186 if (len === 2) return true;
187 for (let i = 1; i < len - 1; i++) {
188 if (!isUint8Array(value[i])) return false;
189 }
190 return true;
191}
192
193function* yieldBoundedBatch(batch) {
194 if (batch.length === 0) {

Callers 10

normalizeSyncSourceFunction · 0.85
normalizeAsyncSourceFunction · 0.85
pipeToFunction · 0.85

Calls 1

isUint8ArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…