MCPcopy
hub / github.com/lodash/lodash / basePickBy

Function basePickBy

lodash.js:3821–3835  ·  view source on GitHub ↗

* The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {

(object, paths, predicate)

Source from the content-addressed store, hash-verified

3819 * @returns {Object} Returns the new object.
3820 */
3821 function basePickBy(object, paths, predicate) {
3822 var index = -1,
3823 length = paths.length,
3824 result = {};
3825
3826 while (++index < length) {
3827 var path = paths[index],
3828 value = baseGet(object, path);
3829
3830 if (predicate(value, path)) {
3831 baseSet(result, castPath(path, object), value);
3832 }
3833 }
3834 return result;
3835 }
3836
3837 /**
3838 * A specialized version of `baseProperty` which supports deep paths.

Callers 2

basePickFunction · 0.85
pickByFunction · 0.85

Calls 4

baseGetFunction · 0.85
baseSetFunction · 0.85
castPathFunction · 0.85
predicateFunction · 0.50

Tested by

no test coverage detected