Debian Codegraph @

node/rxjs/src/internal/util/arrRemove.ts

raw
1 /**
2 * Removes an item from an array, mutating it.
3 * @param arr The array to remove the item from
4 * @param item The item to remove
5 */
6 export function arrRemove<T>(arr: T[] | undefined | null, item: T) {
7 if (arr) {
8 const index = arr.indexOf(item);
9 0 <= index && arr.splice(index, 1);
10 }
11 }