Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / pickBy.js
1 var baseIteratee = require('./internal/baseIteratee'),
2     basePickBy = require('./internal/basePickBy');
3
4 /**
5  * Creates an object composed of the `object` properties `predicate` returns
6  * truthy for. The predicate is invoked with one argument: (value).
7  *
8  * @static
9  * @memberOf _
10  * @category Object
11  * @param {Object} object The source object.
12  * @param {Function|Object|string} [predicate=_.identity] The function invoked per property.
13  * @returns {Object} Returns the new object.
14  * @example
15  *
16  * var object = { 'a': 1, 'b': '2', 'c': 3 };
17  *
18  * _.pickBy(object, _.isNumber);
19  * // => { 'a': 1, 'c': 3 }
20  */
21 function pickBy(object, predicate) {
22   return object == null ? {} : basePickBy(object, baseIteratee(predicate, 2));
23 }
24
25 module.exports = pickBy;