settings
This commit is contained in:
7
tools/omit.ts
Normal file
7
tools/omit.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user