1 var baseClone = require('./_baseClone'),
2 baseConforms = require('./_baseConforms');
4 /** Used to compose bitmasks for cloning. */
5 var CLONE_DEEP_FLAG = 1;
8 * Creates a function that invokes the predicate properties of `source` with
9 * the corresponding property values of a given object, returning `true` if
10 * all predicates return truthy, else `false`.
12 * **Note:** The created function is equivalent to `_.conformsTo` with
13 * `source` partially applied.
19 * @param {Object} source The object of property predicates to conform to.
20 * @returns {Function} Returns the new spec function.
28 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
29 * // => [{ 'a': 1, 'b': 2 }]
31 function conforms(source) {
32 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
35 module.exports = conforms;