githubEdit

object.pick

Returns a filtered copy of an object with only the specified keys, similar to _.pick from lodash / underscore.

You might also be interested in object.omitarrow-up-right.

Install

Install with npmarrow-up-right:

$ npm install --save object.pick

benchmarks

This is the fastest implementationarrow-up-right 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'}

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issuearrow-up-right.

Building docs

(This document was generated by verb-generate-readmearrow-up-right (a verbarrow-up-right generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.mdarrow-up-right.)

To generate the readme and API documentation with verbarrow-up-right:

Running tests

Install dev dependencies:

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkertarrow-up-right. Released under the MIT licensearrow-up-right.


This file was generated by verb-generate-readmearrow-up-right, v0.2.0, on October 27, 2016.

Last updated