32541fe6e670d308fb8e446d64f4ee3f42c08ea0
[yaffs-website] / node_modules / uncss / node_modules / lodash / conforms.js
1 var baseClone = require('./internal/baseClone'),
2     baseConforms = require('./internal/baseConforms');
3
4 /**
5  * Creates a function that invokes the predicate properties of `source` with
6  * the corresponding property values of a given object, returning `true` if
7  * all predicates return truthy, else `false`.
8  *
9  * @static
10  * @memberOf _
11  * @category Util
12  * @param {Object} source The object of property predicates to conform to.
13  * @returns {Function} Returns the new function.
14  * @example
15  *
16  * var users = [
17  *   { 'user': 'barney', 'age': 36 },
18  *   { 'user': 'fred',   'age': 40 }
19  * ];
20  *
21  * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
22  * // => [{ 'user': 'fred', 'age': 40 }]
23  */
24 function conforms(source) {
25   return baseConforms(baseClone(source, true));
26 }
27
28 module.exports = conforms;