export async function asyncIterableToArray( iterator: AsyncIterable ): Promise { const items: T[] = []; for await (const item of iterator) { items.push(item); } return items; }