1.0.0 • Published 6 years ago

@lachenmayer/object-without v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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