Initial commit
[yaffs-website] / node_modules / node-sass / node_modules / lodash / conforms.js
1 var baseClone = require('./_baseClone'),
2     baseConforms = require('./_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  * **Note:** The created function is equivalent to `_.conformsTo` with
10  * `source` partially applied.
11  *
12  * @static
13  * @memberOf _
14  * @since 4.0.0
15  * @category Util
16  * @param {Object} source The object of property predicates to conform to.
17  * @returns {Function} Returns the new spec function.
18  * @example
19  *
20  * var objects = [
21  *   { 'a': 2, 'b': 1 },
22  *   { 'a': 1, 'b': 2 }
23  * ];
24  *
25  * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
26  * // => [{ 'a': 1, 'b': 2 }]
27  */
28 function conforms(source) {
29   return baseConforms(baseClone(source, true));
30 }
31
32 module.exports = conforms;