1 var baseClone = require('./internal/baseClone'),
2 baseMatches = require('./internal/baseMatches');
5 * Creates a function that performs a deep partial comparison between a given
6 * object and `source`, returning `true` if the given object has equivalent
7 * property values, else `false`.
9 * **Note:** This method supports comparing the same values as `_.isEqual`.
14 * @param {Object} source The object of property values to match.
15 * @returns {Function} Returns the new function.
19 * { 'user': 'barney', 'age': 36, 'active': true },
20 * { 'user': 'fred', 'age': 40, 'active': false }
23 * _.filter(users, _.matches({ 'age': 40, 'active': false }));
24 * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
26 function matches(source) {
27 return baseMatches(baseClone(source, true));
30 module.exports = matches;