Return a copy of an object without the given key, or array of keys.
$ cnpm install object-omit
Return a copy of an object without the given key, or array of keys.
npm i object-omit --save-dev
var omit = require('object-omit');
Pass a string key to omit:
omit({a: 'a', b: 'b', c: 'c'}, 'a')
//=> { b: 'b', c: 'c' }
Pass an array of keys to omit:
omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c'])
//=> { b: 'b' }
Returns the object if no keys are passed:
omit({a: 'a', b: 'b', c: 'c'})
//=> {a: 'a', b: 'b', c: 'c'}
Returns an empty object if no value is passed.
omit()
//=> {}
Install dev dependencies:
npm i -d && npm test
Jon Schlinkert
Other projects that I maintain:
Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on February 13, 2015.
Copyright 2013 - present © cnpmjs.org | Home |