Tuple type describing the zipped elements.
Element type yielded by the selector.
Iterable providing the iterables to zip together.
Function receiving the tuple of aligned elements for transformation.
A deferred iterable yielding the selector results for each tuple.
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"]
Applies a selector to tuples produced by zipping multiple iterables.