UNPKG

@lou.codes/iterables

Version:
20 lines (19 loc) 558 B
import type { IsomorphicIterable, IsomorphicIterableItem, ReadOnlyArray, } from "@lou.codes/types"; /** * Turns given iterable or asynchronous iterable into an array. * * @category Asynchronous Reducers * @example * ```typescript * iterableToArray([1, 2, 3, 4]); // [1, 2, 3, 4] * ``` * @param iterable Iterable to be turned into an array. * @returns Array made of iterable items. */ export declare const iterableToArray: <Iterable extends IsomorphicIterable>( iterable: Iterable, ) => Promise<ReadOnlyArray<IsomorphicIterableItem<Iterable>>>;