ts-iterable-functions
    Preparing search index...

    Function zipMapConst

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

      Curried version of _zipMap.

      Type Parameters

      • T extends readonly unknown[]

        Tuple type describing the zipped elements.

      • TOut

        Element type yielded by the selector.

      Parameters

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

        Function receiving the tuple of aligned elements for transformation.

      Returns (src: P0) => Iterable

      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"]