reports/frontend/node_modules/es-toolkit/dist/compat/array/remove.d.mts
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

22 lines
No EOL
846 B
TypeScript

import { ListIteratee } from "../_internal/ListIteratee.mjs";
import { MutableList } from "../_internal/MutableList.mjs";
import { RejectReadonly } from "../_internal/RejectReadonly.mjs";
//#region src/compat/array/remove.d.ts
/**
* Removes all elements from array that predicate returns truthy for and returns an array of the removed elements.
*
* @template L
* @param array - The array to modify.
* @param [predicate] - The function invoked per iteration.
* @returns Returns the new array of removed elements.
*
* @example
* const array = [1, 2, 3, 4];
* const evens = remove(array, n => n % 2 === 0);
* console.log(array); // => [1, 3]
* console.log(evens); // => [2, 4]
*/
declare function remove<L extends MutableList<any>>(array: RejectReadonly<L>, predicate?: ListIteratee<L[0]>): Array<L[0]>;
//#endregion
export { remove };