0.4.0 • Published 5 years ago

@lavadrop/omit v0.4.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

@lavadrop/omit

npm license Travis Build Status codecov Try @lavadrop/omit on RunKit

Part of a library of zero-dependency npm modules that do just one thing.

npm

min + gzip | 114 bytes

source

The opposite of pick; this method creates an object composed of the object's own properties that are not in the list of omitted keys.

Usage

import omit from '@lavadrop/omit'

const obj = { a: 1, b: 2, c: 3 }
omit(obj, 'a', 'c')
// => { b: 2 }

Parameters

NameTypeDescription
objectTThe source object.
keys[K, ...K[]]The object keys to omit.

Type parameters

NameConstraint
Tobject
Kkeyof T

Returns

A new object with specified keys omitted.

Return type

Omit<T, K>