- omit<T, O>(object, ...paths): IfCouldBe<T, Nil, EmptyObject> | {
[K in RemainingKeys<Exclude<T, Nil>, O[number]>]: Exclude<T, Nil>[K]
} Type Parameters
- T extends object | Nil
- O extends readonly (keyof Exclude<T, Nil>)[]
Parameters
- object: T
Rest
...paths: O
Returns IfCouldBe<T, Nil, EmptyObject> | {
[K in RemainingKeys<Exclude<T, Nil>, O[number]>]: Exclude<T, Nil>[K]
}
The opposite of
pick
; this function creates an object composed of the own enumerable string properties of object that are not omitted.Differences from lodash:
paths
must be direct keys ofobject
(they cannot refer to deeper properties)Contribution to minified bundle size, when it is the only function imported: