(generator: AsyncGenerator<T>)
| 3 | import { codeChunker } from "./code"; |
| 4 | |
| 5 | async function genToArr<T>(generator: AsyncGenerator<T>): Promise<T[]> { |
| 6 | const result: T[] = []; |
| 7 | for await (const item of generator) { |
| 8 | result.push(item); |
| 9 | } |
| 10 | return result; |
| 11 | } |
| 12 | |
| 13 | async function genToStrs( |
| 14 | generator: AsyncGenerator<ChunkWithoutID>, |