Function toArraySync

  • Converts the input sync iterable to an array. Returns a function that accepts an input sync iterable and returns an array of the elements from the input sync iterable.

    Returns

    A function that accepts an input sync iterable and returns an array.

    Example

    const input = iterableOf([1, 2, 3, 4, 5]);
    const result = toArraySync()(input); // [1, 2, 3, 4, 5]

    Remarks

    Available as toArray when imported from peter-piper/sync.

    Type Parameters

    • T

      The type of elements in the input sync iterable.

    Returns ((input: Iterable<T>) => T[])

      • (input: Iterable<T>): T[]
      • Parameters

        • input: Iterable<T>

        Returns T[]

Generated using TypeDoc