1.3.0 • Published 7 years ago

object.pick v1.3.0

Weekly downloads
16,109,745
License
MIT
Repository
github
Last release
7 years ago

object.pick NPM version NPM monthly downloads NPM total downloads Linux Build Status

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.omit.

Install

Install with npm:

$ npm install --save object.pick

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

About

Related projects

  • extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util. | homepage
  • get-value: Use property paths (a.b.c) to get a nested value from an object. | homepage
  • mixin-deep: Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | homepage
  • set-value: Create nested values and any intermediaries using dot notation ('a.b.c') paths. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

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

To generate the readme and API documentation with verb:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


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

nanomatchfinedarchetype-librarycomponennenttvuedragdropuploadimagespopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-imagemasterodin-cloud-sdk-corern-send-smsspecify-importsbabel-specify-imports@icanpm/api-mastergew-nodejs-api-client@arisageha/react-lazyload@arisageha/react-lazyload-fix@cashremit/cr-streamline-iconsreact-native-template-rfbasecloud-archive-s3airscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-apideneme323112react-native-nodeifynodeify-rn@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modbitgetreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewercthpb-plugin-socialreact-native-printer-brothersrn-pdf-reader-offlinereact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-nativejs4cytoscape@mink-opn/build-tokensquoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-object_@saaspe/componentsplginrn-nodeify-testexpand-react-bridge@everything-registry/sub-chunk-2365ond@geeky-apo/react-native-advanced-clipboardka-flow.jsl2forlernalib-errorlitepie-datepicker-gabehelp-widgethexyun.helpershot-zone-vuehope-corekiwiaikhaled-salem-custom-componentsgoogle-remakegulp-cachekui-mobilelaravel-elixir-puginline-react-styleiex-sdkjamuskalimjesusdemojeuxuiliverecordloadusersmoonwalkerswap-default-token-listsnetwork-dataset-serverng-search-dropdownnil-buildmarkdown-tocmarkdown-toc-cleanedmarkdown-toc-sefmarkdown-toc-unlazymarkdown-toc-gitbookmarkdown-toc-reduxmarkdown-elfmncssmggauharmiracle-webpack-tree-shakingmpesa-cookiempesa-cookie-jarhttp-app-routerjspm-configjrennsoh88-react-native-scroll-indicatorjson-images-saverjs-utils-jll2instructure-ui
1.3.0

7 years ago

1.2.0

7 years ago

1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago