asyncerator
Version:
Provide supporting types for AsyncIterable/AsyncIterableIterators, promisified stream.pipeline implementation, and Array-like utility operators, sources and sinks.
8 lines (7 loc) • 330 B
TypeScript
import { type Asyncable } from '../asyncerator';
/**
* Turn an async iterable iterator into an Array.
* This will wait until the iterator is done before returning an array, so be careful using this
* with endless iterators (in other words, don't do that).
*/
export default function <T>(iterator: Asyncable<T>): Promise<T[]>;