Returns a filtered copy of an object with only the specified keys, like
pick
from lo-dash / underscore.
Install with npm
npm i object.pick --save
This is the fastest implementation I tested. Pull requests welcome!
var pick = require('object.pick');
pick({a: 'a', b: 'b'}, 'a')
//=> {a: 'a'}
pick({a: 'a', b: 'b', c: 'c'}, ['a', 'b'])
//=> {a: 'a', b: 'b'}
Install dev dependencies:
npm i -d && npm test
Jon Schlinkert
Copyright (c) 2015-2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on February 13, 2015.