@js-data-tools/js-helpers
Version:
A set of JavaScript / TypeScript helper functions for parsing, converting, transforming and formatting data.
11 lines (10 loc) • 508 B
TypeScript
/**
* Reads all values from the asynchronous stream (iterable) and stores them in the array.
*
* @since 0.1.2
* @category iterable
* @param source - An async stream of values to iterate.
* @param {Array} [target] - Reference to the array to append values to. A new array will be created if this parameter is null or omitted.
* @returns {Promise<Array<T>>} A promise for the resulting array.
*/
export declare function toArrayAsync<T>(source: AsyncIterable<T>, target?: Array<T>): Promise<Array<T>>;