alias for Array.fromAsync.

  • Creates an array from an async iterator or iterable object.

    Type Parameters

    • T

    Parameters

    • iterableOrArrayLike:
          | AsyncIterable<T, any, any>
          | Iterable<T | PromiseLike<T>, any, any>
          | ArrayLike<T | PromiseLike<T>>

      An async iterator or array-like object to convert to an array.

    Returns Promise<T[]>

  • Creates an array from an async iterator or iterable object.

    Type Parameters

    • T
    • U

    Parameters

    • iterableOrArrayLike: AsyncIterable<T, any, any> | Iterable<T, any, any> | ArrayLike<T>

      An async iterator or array-like object to convert to an array.

    • mapFn: (value: Awaited<T>, index: number) => U
    • OptionalthisArg: any

      Value of 'this' used when executing mapfn.

    Returns Promise<Awaited<U>[]>