9 lines
199 B
TypeScript
9 lines
199 B
TypeScript
|
export function ignore<T extends AnyObject, K extends keyof T>(
|
||
|
obj: T,
|
||
|
...keys: K[]
|
||
|
): Omit<T, K> {
|
||
|
const result = { ...obj };
|
||
|
for (const key of keys) delete result[key];
|
||
|
return result;
|
||
|
}
|