1 var baseClone = require('../internal/baseClone'),
2 baseMatches = require('../internal/baseMatches');
5 * Creates a function that performs a deep comparison between a given object
6 * and `source`, returning `true` if the given object has equivalent property
7 * values, else `false`.
9 * **Note:** This method supports comparing arrays, booleans, `Date` objects,
10 * numbers, `Object` objects, regexes, and strings. Objects are compared by
11 * their own, not inherited, enumerable properties. For comparing a single
12 * own or inherited property value see `_.matchesProperty`.
17 * @param {Object} source The object of property values to match.
18 * @returns {Function} Returns the new function.
22 * { 'user': 'barney', 'age': 36, 'active': true },
23 * { 'user': 'fred', 'age': 40, 'active': false }
26 * _.filter(users, _.matches({ 'age': 40, 'active': false }));
27 * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
29 function matches(source) {
30 return baseMatches(baseClone(source, true));
33 module.exports = matches;