//#region src/Array/mapEach.d.ts /** * # mapEach * * ```ts * function Array.mapEach( * target: readonly T[], * mapper: ( * value: NoInfer, * index: number, * target: readonly NoInfer[], * ) => U, * ): readonly U[] * ``` * * Applies the `mapper` function to each element in `array`, returning a new array with the mapped elements. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.mapEach([1, 2, 3, 4], (x) => x * 2); // [2, 4, 6, 8] * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe( * [1, 2, 3, 4], * Array.mapEach((x) => x * 2), * ); // [2, 4, 6, 8] * ``` * */ declare const mapEach: { (mapper: (value: NoInfer, index: number, target: readonly NoInfer[]) => U): (target: T[]) => U[]; (mapper: (value: NoInfer, index: number, target: readonly NoInfer[]) => U): (target: readonly T[]) => readonly U[]; (target: T[], mapper: (value: NoInfer, index: number, target: readonly NoInfer[]) => U): U[]; (target: readonly T[], mapper: (value: NoInfer, index: number, target: readonly NoInfer[]) => U): readonly U[]; }; //#endregion export { mapEach };