MCPcopy
hub / github.com/lodash/lodash / pickBy

Function pickBy

lodash.js:13680–13691  ·  view source on GitHub ↗

* Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @para

(object, predicate)

Source from the content-addressed store, hash-verified

13678 * // => { 'a': 1, 'c': 3 }
13679 */
13680 function pickBy(object, predicate) {
13681 if (object == null) {
13682 return {};
13683 }
13684 var props = arrayMap(getAllKeysIn(object), function(prop) {
13685 return [prop];
13686 });
13687 predicate = getIteratee(predicate);
13688 return basePickBy(object, props, function(value, path) {
13689 return predicate(value, path[0]);
13690 });
13691 }
13692
13693 /**
13694 * This method is like `_.get` except that if the resolved value is a

Callers 1

omitByFunction · 0.85

Calls 5

arrayMapFunction · 0.85
getAllKeysInFunction · 0.85
getIterateeFunction · 0.85
basePickByFunction · 0.85
predicateFunction · 0.50

Tested by

no test coverage detected