MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / teeIterator

Method teeIterator

packages/core/src/common/stream.ts:157–168  ·  view source on GitHub ↗
(queue: Array<Promise<IteratorResult<Item>>>)

Source from the content-addressed store, hash-verified

155 const iterator = this.iterator();
156
157 const teeIterator = (queue: Array<Promise<IteratorResult<Item>>>): AsyncIterator<Item> => {
158 return {
159 next: () => {
160 if (queue.length === 0) {
161 const result = iterator.next();
162 left.push(result);
163 right.push(result);
164 }
165 return queue.shift()!;
166 },
167 };
168 };
169
170 return [
171 new Stream(() => teeIterator(left), this.controller),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected