ts-iterable-functions
    Preparing search index...

    Function _zipMap

    • Applies a selector to tuples produced by zipping multiple iterables.

      Type Parameters

      • T extends readonly unknown[]

        Tuple type describing the zipped elements.

      • TOut

        Element type yielded by the selector.

      Parameters

      • src: Iterablified<T>

        Iterable providing the iterables to zip together.

      • selector: (...args: T) => TOut

        Function receiving the tuple of aligned elements for transformation.

      Returns Iterable<TOut>

      A deferred iterable yielding the selector results for each tuple.

      Error Rethrows any error thrown by selector or while enumerating the source iterables.

      const inputs: Iterablified<[number, string]> = [
      [1, 2],
      ["a", "b"],
      ];
      const labels = Array.from(
      _zipMap(inputs, (value, letter) => `${value}${letter}`)
      );
      console.log(labels); // ["1a", "2b"]

      or using the curried version:

      const labels = Array.from(
      pipeInto(
      [
      [10, 20],
      ["x", "y"],
      ] as Iterablified<[number, string]>,
      zipMap((value, letter) => `${value}${letter}`)
      )
      );
      console.log(labels); // ["10x", "20y"]