woocommerce/plugins/woocommerce-blocks/assets/js/utils/object-operations.ts

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;
}