//#region src/Array/replace.d.ts /** * # replace * * ```ts * function Array.replace( * target: readonly T[], * value: NoInfer, * replacement: NoInfer, * ): readonly T[] * ``` * * Replaces the first occurrence of `value` with `replacement` in `target` array. If the value is not found or if value and replacement are the same, returns the original array unchanged. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.replace([1, 2, 3, 2], 2, 5); // [1, 5, 3, 2] * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe([1, 2, 3, 2], Array.replace(2, 5)); // [1, 5, 3, 2] * ``` * */ declare const replace: { (value: NoInfer, replacement: NoInfer): (target: T[]) => T[]; (value: NoInfer, replacement: NoInfer): (target: readonly T[]) => readonly T[]; (target: T[], value: NoInfer, replacement: NoInfer): T[]; (target: readonly T[], value: NoInfer, replacement: NoInfer): readonly T[]; }; //#endregion export { replace };