1 var baseClone = require('../internal/baseClone'),
2 baseMatchesProperty = require('../internal/baseMatchesProperty');
5 * Creates a function that compares the property value of `path` on a given
8 * **Note:** This method supports comparing arrays, booleans, `Date` objects,
9 * numbers, `Object` objects, regexes, and strings. Objects are compared by
10 * their own, not inherited, enumerable properties.
15 * @param {Array|string} path The path of the property to get.
16 * @param {*} srcValue The value to match.
17 * @returns {Function} Returns the new function.
21 * { 'user': 'barney' },
25 * _.find(users, _.matchesProperty('user', 'fred'));
26 * // => { 'user': 'fred' }
28 function matchesProperty(path, srcValue) {
29 return baseMatchesProperty(path, baseClone(srcValue, true));
32 module.exports = matchesProperty;