react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / lang / isMatch.js
80742 viewsvar baseIsMatch = require('../internal/baseIsMatch'),1bindCallback = require('../internal/bindCallback'),2getMatchData = require('../internal/getMatchData');34/**5* Performs a deep comparison between `object` and `source` to determine if6* `object` contains equivalent property values. If `customizer` is provided7* it is invoked to compare values. If `customizer` returns `undefined`8* comparisons are handled by the method instead. The `customizer` is bound9* to `thisArg` and invoked with three arguments: (value, other, index|key).10*11* **Note:** This method supports comparing properties of arrays, booleans,12* `Date` objects, numbers, `Object` objects, regexes, and strings. Functions13* and DOM nodes are **not** supported. Provide a customizer function to extend14* support for comparing other values.15*16* @static17* @memberOf _18* @category Lang19* @param {Object} object The object to inspect.20* @param {Object} source The object of property values to match.21* @param {Function} [customizer] The function to customize value comparisons.22* @param {*} [thisArg] The `this` binding of `customizer`.23* @returns {boolean} Returns `true` if `object` is a match, else `false`.24* @example25*26* var object = { 'user': 'fred', 'age': 40 };27*28* _.isMatch(object, { 'age': 40 });29* // => true30*31* _.isMatch(object, { 'age': 36 });32* // => false33*34* // using a customizer callback35* var object = { 'greeting': 'hello' };36* var source = { 'greeting': 'hi' };37*38* _.isMatch(object, source, function(value, other) {39* return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;40* });41* // => true42*/43function isMatch(object, source, customizer, thisArg) {44customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;45return baseIsMatch(object, getMatchData(source), customizer);46}4748module.exports = isMatch;495051