Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / pickByCallback.js
1 var baseForIn = require('./baseForIn');
2
3 /**
4  * A specialized version of `_.pick` which picks `object` properties `predicate`
5  * returns truthy for.
6  *
7  * @private
8  * @param {Object} object The source object.
9  * @param {Function} predicate The function invoked per iteration.
10  * @returns {Object} Returns the new object.
11  */
12 function pickByCallback(object, predicate) {
13   var result = {};
14   baseForIn(object, function(value, key, object) {
15     if (predicate(value, key, object)) {
16       result[key] = value;
17     }
18   });
19   return result;
20 }
21
22 module.exports = pickByCallback;