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

Method teeIterator

packages/baseai/src/dev/utils/stream/stream.ts:162–175  ·  view source on GitHub ↗
(
			queue: Array<Promise<IteratorResult<Item>>>
		)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected