Function zipSync

  • Zips together elements from the input sync iterables into arrays. Returns a function that accepts an input sync iterable of sync iterables and yields arrays of elements from the input sync iterables, where the first elements of the input sync iterables are combined, the second elements are combined, and so on.

    Returns

    A function that accepts an input sync iterable of sync iterables and returns an iterable.

    Example

    const input = iterable([[1, 2, 3], ['a', 'b', 'c']]);
    const result = toArraySync(zipSync()(input)); // [[1, 'a'], [2, 'b'], [3, 'c']]

    Remarks

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

    Type Parameters

    • T extends Iterable<unknown, T>

      The type of elements in the input sync iterable of sync iterables.

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

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

        • input: Iterable<T>

        Returns Iterable<ElementOf<T>[]>

Generated using TypeDoc