Urara-Blog/node_modules/.pnpm-store/v3/files/8b/6127f20974dbd60f354d12adcd8899e9ec556046548b7f6c15817e54327f027ee9fe7980df37596375fcd39cdf467e35cdc131f57b2a57692ed9bc040894e0
2022-08-14 01:14:53 +08:00

36 lines
1.1 KiB
Text

var baseIsMatch = require('./_baseIsMatch'),
getMatchData = require('./_getMatchData');
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values.
*
* **Note:** This method is equivalent to `_.matches` when `source` is
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.isMatch(object, { 'b': 2 });
* // => true
*
* _.isMatch(object, { 'b': 1 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
module.exports = isMatch;