MCPcopy Index your code
hub / github.com/rocicorp/mono / AsyncIterableIteratorToArrayWrapperImpl

Class AsyncIterableIteratorToArrayWrapperImpl

src/scan-iterator.ts:149–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149class AsyncIterableIteratorToArrayWrapperImpl<V>
150 implements AsyncIterableIterator<V>
151{
152 private readonly _it: AsyncIterableIterator<V>;
153
154 constructor(it: AsyncIterableIterator<V>) {
155 this._it = it;
156 }
157
158 next() {
159 return this._it.next();
160 }
161
162 [Symbol.asyncIterator](): AsyncIterableIterator<V> {
163 return this._it[Symbol.asyncIterator]();
164 }
165
166 toArray(): Promise<V[]> {
167 return asyncIterableToArray(this._it);
168 }
169}
170
171async function* scanIterator<Options extends ScanOptions, Value>(
172 toValue: ToValue<Options, Value>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected