a14131fef317248156c9b1a7d4fa3091916b092d
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / isMatch.js
1 var baseIsMatch = require('./_baseIsMatch'),
2     getMatchData = require('./_getMatchData');
3
4 /**
5  * Performs a deep comparison between `object` and `source` to determine if
6  * `object` contains equivalent property values.
7  *
8  * **Note:** This method supports comparing the same values as `_.isEqual`.
9  *
10  * @static
11  * @memberOf _
12  * @category Lang
13  * @param {Object} object The object to inspect.
14  * @param {Object} source The object of property values to match.
15  * @returns {boolean} Returns `true` if `object` is a match, else `false`.
16  * @example
17  *
18  * var object = { 'user': 'fred', 'age': 40 };
19  *
20  * _.isMatch(object, { 'age': 40 });
21  * // => true
22  *
23  * _.isMatch(object, { 'age': 36 });
24  * // => false
25  */
26 function isMatch(object, source) {
27   return object === source || baseIsMatch(object, source, getMatchData(source));
28 }
29
30 module.exports = isMatch;