UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines 603 B
//#region src/array/remove.d.ts /** * `remove(target, value)` * * Removes the first occurrence of `value` from `target` array. If the value is not found, returns the original array unchanged. * * ```ts * remove([1, 2, 3, 2], 2); // [1, 3, 2] * ``` * * ```ts * pipe([1, 2, 3, 2], remove(2)); // [1, 3, 2] * ``` */ declare const remove: { <T>(value: NoInfer<T>): (target: T[]) => T[]; <T>(value: NoInfer<T>): (target: readonly T[]) => readonly T[]; <T>(target: T[], value: NoInfer<T>): T[]; <T>(target: readonly T[], value: NoInfer<T>): readonly T[]; }; //#endregion export { remove };