Skip to content

isabella232/object.pick

 
 

Repository files navigation

object.pick NPM version Build Status

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

benchmarks

This is the fastest implementation I tested. Pull requests welcome!

Usage

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'}

Running tests

Install dev dependencies:

npm i -d && npm test

Author

Jon Schlinkert

License

Copyright (c) 2015-2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 13, 2015.

About

(object pick) returns a filtered copy of an object with only the specified keys, exactly like `pick` from lo-dash / underscore.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%