map (Functional Programming) es-toolkit
Creates a function that transforms every element of an array, equivalent to Array.prototype.map. Use it with pipe.
This helper is specific to es-toolkit/fp. Use it when you want this operation as part of a pipe pipeline.
Usage
map builds a new array by calling callbackfn on each element. It is lazy-capable: inside a pipe it is fused with adjacent lazy operations, so a trailing take can stop the work early.
Parameters
A function called for each element; its return value becomes the corresponding element of the output array.
Returns
A function that maps a readonly T[] to a new U[].
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.