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

Function consumeStart

deps/undici/undici.js:17342–17368  ·  view source on GitHub ↗
(consume2)

Source from the content-addressed store, hash-verified

17340 }
17341 __name(consume, "consume");
17342 function consumeStart(consume2) {
17343 if (consume2.body === null) {
17344 return;
17345 }
17346 const { _readableState: state } = consume2.stream;
17347 if (state.bufferIndex) {
17348 const start = state.bufferIndex;
17349 const end = state.buffer.length;
17350 for (let n = start; n < end; n++) {
17351 consumePush(consume2, state.buffer[n]);
17352 }
17353 } else {
17354 for (const chunk of state.buffer) {
17355 consumePush(consume2, chunk);
17356 }
17357 }
17358 if (state.endEmitted) {
17359 consumeEnd(this[kConsume], this._readableState.encoding);
17360 } else {
17361 consume2.stream.on("end", function() {
17362 consumeEnd(this[kConsume], this._readableState.encoding);
17363 });
17364 }
17365 consume2.stream.resume();
17366 while (consume2.stream.read() != null) {
17367 }
17368 }
17369 __name(consumeStart, "consumeStart");
17370 function chunksDecode(chunks, length, encoding) {
17371 if (chunks.length === 0 || length === 0) {

Callers 1

consumeFunction · 0.70

Calls 5

consumePushFunction · 0.70
consumeEndFunction · 0.70
resumeMethod · 0.65
onMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…