1.3.0 • Published 8 years ago

object.pick v1.3.0

Weekly downloads
16,109,745
License
MIT
Repository
github
Last release
8 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_modreact-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-2365ondgriffin-ui-librarytailwind-vector-effectsyncbackbasestabular-clitest-carosello-campustest-library-123test-haptik-libteadanteatest-npm-jjmessiwordassoservervue-button-test1webchewoven-challenge-deploywow.js-juzixdms3wifi_configuration_packagewhat-countrywtf-scriptssuperset-plugin-chart-hello-world2supercluster-googlemaps-adapter-clonestechfox-icontechfox-react-feathertemplatespotify-ds-sesticky-scroll-catchstp-cdktestapateste_cegidtestnpm_lmnsvelte-component-libtextfield-samplevue-compmentvision-camera-plugin-scan-facesvision-camera-base64-resizedvcloudcam-playkit-js-hlsvideo-multi-uploadervue-dev-clone@donapot/mylibtest@cryptocode99/token-lists@ctfdio/picocss-themes@ct-note/table@ct-note/warning@cs6/react-native-test-native-view-library@csabapalfi/markdown-toc@ct-note/image
1.3.0

8 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

11 years ago