Like lo-dash/underscore `.pick()` but recursively merges and picks deeply nested occurences of a property.
MIT License
Like lo-dash/underscore
.pick()
but recursively merges and picks deeply nested occurences of a property.
npm i deep-pick --save
npm test
var deepPick = require('deep-pick');
var obj = {foo: {a: 'a'}, bar: {foo: {b: 'b'}}, baz: 'baz'};
deepPick(obj, 'foo');
//=> {foo: {a: 'a', b: 'b'}}
Pass value: true
to return only the value for the specified property:
var obj = {foo: {a: 'a'}, bar: {foo: {b: 'b'}}, baz: 'baz'};
deepPick(obj, 'foo', {value: true});
//=> {a: 'a', b: 'b'}
Jon Schlinkert
Other projects that I maintain:
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
This file was generated by verb-cli on September 22, 2014.