Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 9x 2x 9x 10x 9x | import { SetCompatible } from "./_types";
/**
*
* @mutation
*
* @example
* deleteAll([1,2])([]) => [1,2]
* deleteAll([1,2])([2,3]) => [1]
*
* @param set
* @returns `true` if the Set was modified, otherwise `false`
*/
export const deleteAll =
<T>(set: Set<T>) =>
(values: SetCompatible<T>): Set<T> => {
values.forEach((value) => set.delete(value));
return set;
};
|