Add without

This commit is contained in:
Jon Staab
2024-05-20 09:36:16 -07:00
parent 69b8bb3b54
commit 1160cedc0b
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -91,6 +91,8 @@ export const difference = <T>(a: T[], b: T[]) => {
export const remove = <T>(a: T, b: T[]) => b.filter(x => x !== a)
export const without = <T>(a: T[], b: T[]) => b.filter(x => !a.includes(x))
export const clamp = ([min, max]: [number, number], n: number) => Math.min(max, Math.max(min, n))
export const tryCatch = async <T>(f: () => Promise<T | void> | T | void, onError?: (e: Error) => void): Promise<T | void> => {