9 lines
173 B
TypeScript
9 lines
173 B
TypeScript
|
/**
|
||
|
* Returns an object without a key.
|
||
|
*/
|
||
|
export function objectOmit< T, K extends keyof T >( obj: T, key: K ) {
|
||
|
const { [ key ]: omit, ...rest } = obj;
|
||
|
|
||
|
return rest;
|
||
|
}
|