This commit is contained in:
Gavin McDonald
2025-04-16 09:18:41 -04:00
parent 4c5eb541bc
commit 3018cd7c10
2 changed files with 51 additions and 0 deletions

7
tools/omit.ts Normal file
View File

@@ -0,0 +1,7 @@
export default function omit<T extends Record<string, any>>(
obj: T,
propToRemove: keyof T,
): Omit<T, typeof propToRemove> {
const { [propToRemove]: _, ...rest } = obj;
return rest;
}