@lachenmayer/object-without

1.0.0 • Public • Published

object-without

Returns a new object with the given key(s) removed. Does not mutate the input object.

npm install @lachenmayer/object-without
var without = require('@lachenmayer/object-without')

without({ a: 1, b: 2, c: 3 }, 'c') // { a: 1, b: 2 }
without({ a: 1, b: 2, c: 3 }, ['b', 'c']) // { a: 1 }
without({ a: 1, b: 2, c: 3 }, 'unchanged - no such key') // { a: 1, b: 2, c: 3 }
without([1, 2, 3], 1) // [1, undefined, 3]
without(null, 'anything') // null

Dependents (0)

Package Sidebar

Install

npm i @lachenmayer/object-without

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

103 kB

Total Files

5

Last publish

Collaborators

  • lachenmayer