https://github.com/jonschlinkert/deep-pick
Like lo-dash/underscore `.pick()` but recursively merges and picks deeply nested occurences of a property.
https://github.com/jonschlinkert/deep-pick
javascript lodash object pick
Last synced: 2 months ago
JSON representation
Like lo-dash/underscore `.pick()` but recursively merges and picks deeply nested occurences of a property.
- Host: GitHub
- URL: https://github.com/jonschlinkert/deep-pick
- Owner: jonschlinkert
- License: mit
- Created: 2014-09-22T17:49:16.000Z (about 11 years ago)
- Default Branch: pick
- Last Pushed: 2014-09-22T17:50:08.000Z (about 11 years ago)
- Last Synced: 2025-07-10T15:06:32.161Z (3 months ago)
- Topics: javascript, lodash, object, pick
- Language: JavaScript
- Size: 102 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# deep-pick [](http://badge.fury.io/js/deep-pick)
> Like lo-dash/underscore `.pick()` but recursively merges and picks deeply nested occurences of a property.
## Install
#### Install with [npm](npmjs.org)```bash
npm i deep-pick --save
```## Run tests
```bash
npm test
```## Usage
```js
var deepPick = require('deep-pick');
var obj = {foo: {a: 'a'}, bar: {foo: {b: 'b'}}, baz: 'baz'};deepPick(obj, 'foo');
//=> {foo: {a: 'a', b: 'b'}}
```### options.value
Pass `value: true` to return **only the value** for the specified property:
```js
var obj = {foo: {a: 'a'}, bar: {foo: {b: 'b'}}, baz: 'baz'};deepPick(obj, 'foo', {value: true});
//=> {a: 'a', b: 'b'}
```## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)### Other javascript/node.js utils
Other projects that I maintain:
- [arrayify-compact](https://github.com/jonschlinkert/arrayify-compact)
- [compact-object](https://github.com/jonschlinkert/compact-object)
- [delete](https://github.com/jonschlinkert/delete)
- [for-in](https://github.com/jonschlinkert/for-in)
- [for-own](https://github.com/jonschlinkert/for-own)
- [has-any](https://github.com/jonschlinkert/has-any)
- [has-value](https://github.com/jonschlinkert/has-value)
- [is-number](https://github.com/jonschlinkert/is-number)
- [is-plain-object](https://github.com/jonschlinkert/is-plain-object)
- [mixin-deep](https://github.com/jonschlinkert/mixin-deep)
- [mixin-object](https://github.com/jonschlinkert/mixin-object)
- [object-length](https://github.com/jonschlinkert/object-length)
- [omit-empty](https://github.com/jonschlinkert/omit-empty)
- [reduce-object](https://github.com/jonschlinkert/reduce-object)## License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 22, 2014._