# Module: omit
Takes an object and a list of properties to remove, and returns a new object equal to the original one but the listed properties removed.
import { omit } from 'utilist';
omit({ prop1: 'stays', prop2: 'leaves' }, ['prop2']); // returns { prop1: 'stays' }
remark
Currently nested properties are not supported.
# Functions
# omit
▸ omit‹T, K›(source
: T, properties
: K[]): T
Defined in src/omit.ts:22
Type parameters:
▪ T
▪ K: keyof T
Parameters:
Name | Type | Description |
---|---|---|
source | T | The original object to remove the properties from. |
properties | K[] | An array of property names to be removed. |
Returns: T