MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / teeIterator

Method teeIterator

out/cli.cjs:69177–69188  ·  view source on GitHub ↗
(queue)

Source from the content-addressed store, hash-verified

69175 /**
69176 * Splits the stream into two streams which can be
69177 * independently read from at different speeds.
69178 */
69179 tee() {
69180 const left = [];
69181 const right = [];
69182 const iterator2 = this.iterator();
69183 const teeIterator = (queue) => {
69184 return {
69185 next: () => {
69186 if (queue.length === 0) {
69187 const result = iterator2.next();
69188 left.push(result);
69189 right.push(result);
69190 }
69191 return queue.shift();

Callers

nothing calls this directly

Calls 3

nextMethod · 0.45
pushMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected