MCPcopy Index your code
hub / github.com/nodejs/node / #drain

Method #drain

lib/internal/streams/iter/push.js:451–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

449 // ===========================================================================
450
451 #drain() {
452 if (this.#slots.length === 1) {
453 return this.#slots.shift();
454 }
455
456 const result = [];
457 for (let i = 0; i < this.#slots.length; i++) {
458 const slot = this.#slots.get(i);
459 for (let j = 0; j < slot.length; j++) {
460 ArrayPrototypePush(result, slot[j]);
461 }
462 }
463 this.#slots.clear();
464 return result;
465 }
466
467 #resolvePendingReads() {
468 while (this.#pendingReads.length > 0) {

Callers 2

readMethod · 0.95
#resolvePendingReadsMethod · 0.95

Calls 3

getMethod · 0.65
clearMethod · 0.65
shiftMethod · 0.45

Tested by

no test coverage detected