//#region src/Map/findReplace.d.ts /** * # findReplace * * ```ts * function Map.findReplace( * target: ReadonlyMap, * predicate: ( * value: NoInfer, * key: NoInfer, * target: ReadonlyMap, * ) => boolean, * replacement: NoInfer, * ): ReadonlyMap * ``` * * Finds the first entry in the map that satisfies the provided `predicate` function and replaces its value with `replacement`, returning a new map with the replaced value. * * ## Example * * ```ts [data-first] * import { Map } from "@monstermann/map"; * * Map.findReplace( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * (value) => value > 1, * 10, * ); // Map(3) { "a" => 1, "b" => 10, "c" => 3 } * ``` * * ```ts [data-last] * import { Map } from "@monstermann/map"; * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * Map.findReplace((value) => value > 1, 10), * ); // Map(3) { "a" => 1, "b" => 10, "c" => 3 } * ``` * */ declare const findReplace: { (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer): (target: Map) => Map; (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer): (target: ReadonlyMap) => ReadonlyMap; (target: Map, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer): Map; (target: ReadonlyMap, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer): ReadonlyMap; }; //#endregion export { findReplace };