//#region src/Map/map.d.ts /** * # map * * ```ts * function Map.map( * target: ReadonlyMap, * key: NoInfer, * transform: ( * value: NoInfer, * key: NoInfer, * target: ReadonlyMap, * ) => V, * ): ReadonlyMap * ``` * * Transforms the value at the specified key using the provided function. Returns the original map if the key doesn't exist. * * ## Example * * ```ts [data-first] * import { Map } from "@monstermann/map"; * * Map.map( * new Map([ * ["a", 1], * ["b", 2], * ]), * "a", * (value) => value * 2, * ); // Map(2) { "a" => 2, "b" => 2 } * * Map.map( * new Map([ * ["a", 1], * ["b", 2], * ]), * "c", * (value) => value * 2, * ); // Map(2) { "a" => 1, "b" => 2 } * ``` * * ```ts [data-last] * import { Map } from "@monstermann/map"; * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ]), * Map.map("a", (value) => value * 2), * ); // Map(2) { "a" => 2, "b" => 2 } * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ]), * Map.map("c", (value) => value * 2), * ); // Map(2) { "a" => 1, "b" => 2 } * ``` * */ declare const map: { (key: NoInfer, transform: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => V): (target: Map) => Map; (key: NoInfer, transform: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => V): (target: ReadonlyMap) => ReadonlyMap; (target: Map, key: NoInfer, transform: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => V): Map; (target: ReadonlyMap, key: NoInfer, transform: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => V): ReadonlyMap; }; //#endregion export { map };