1 var baseClone = require('./_baseClone'),
2 baseMatchesProperty = require('./_baseMatchesProperty');
5 * Creates a function that performs a deep partial comparison between the
6 * value at `path` of a given object to `srcValue`, returning `true` if the
7 * object value is equivalent, else `false`.
9 * **Note:** This method supports comparing the same values as `_.isEqual`.
14 * @param {Array|string} path The path of the property to get.
15 * @param {*} srcValue The value to match.
16 * @returns {Function} Returns the new function.
20 * { 'user': 'barney' },
24 * _.find(users, _.matchesProperty('user', 'fred'));
25 * // => { 'user': 'fred' }
27 function matchesProperty(path, srcValue) {
28 return baseMatchesProperty(path, baseClone(srcValue, true));
31 module.exports = matchesProperty;