0.2.0 • Published 8 years ago
object-picker v0.2.0
object-picker
Pick only what you want in an object.
Install
$ npm install --save object-picker
Usage
const picker = require('object-picker')
const obj = {
foo: undefined,
bar: '',
baz: 'lol',
zip: 'leave me alone'
}
picker(obj, ['foo', 'bar', 'barbee'])
//=> {foo: undefined, bar: ''}
API
objectPicker(obj, selections)
obj
Type: Object
The input object.
selections
Type: Array
Default: []
The fields to select.
License
MIT © EGOIST