MCPcopy Create free account
hub / github.com/nodejs/node / discardLeadingBytes

Method discardLeadingBytes

deps/undici/undici.js:16675–16691  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

16673 }
16674 }
16675 discardLeadingBytes(count) {
16676 while (count > 0 && this.lineChunkIndex < this.chunks.length) {
16677 const chunk = this.chunks[this.lineChunkIndex];
16678 const remaining = chunk.length - this.linePos;
16679 if (count < remaining) {
16680 this.linePos += count;
16681 count = 0;
16682 } else {
16683 count -= remaining;
16684 this.lineChunkIndex++;
16685 this.linePos = 0;
16686 }
16687 }
16688 this.chunkIndex = this.lineChunkIndex;
16689 this.pos = this.linePos;
16690 this.dropConsumedChunks();
16691 }
16692 handleBOM() {
16693 const first = this.peekBufferedByte(0);
16694 const second = this.peekBufferedByte(1);

Callers 1

handleBOMMethod · 0.45

Calls 1

dropConsumedChunksMethod · 0.45

Tested by

no test coverage detected