react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / lang / isEqual.js
80742 viewsvar baseIsEqual = require('../internal/baseIsEqual'),1bindCallback = require('../internal/bindCallback');23/**4* Performs a deep comparison between two values to determine if they are5* equivalent. If `customizer` is provided it is invoked to compare values.6* If `customizer` returns `undefined` comparisons are handled by the method7* instead. The `customizer` is bound to `thisArg` and invoked with three8* arguments: (value, other [, index|key]).9*10* **Note:** This method supports comparing arrays, booleans, `Date` objects,11* numbers, `Object` objects, regexes, and strings. Objects are compared by12* their own, not inherited, enumerable properties. Functions and DOM nodes13* are **not** supported. Provide a customizer function to extend support14* for comparing other values.15*16* @static17* @memberOf _18* @alias eq19* @category Lang20* @param {*} value The value to compare.21* @param {*} other The other value to compare.22* @param {Function} [customizer] The function to customize value comparisons.23* @param {*} [thisArg] The `this` binding of `customizer`.24* @returns {boolean} Returns `true` if the values are equivalent, else `false`.25* @example26*27* var object = { 'user': 'fred' };28* var other = { 'user': 'fred' };29*30* object == other;31* // => false32*33* _.isEqual(object, other);34* // => true35*36* // using a customizer callback37* var array = ['hello', 'goodbye'];38* var other = ['hi', 'goodbye'];39*40* _.isEqual(array, other, function(value, other) {41* if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {42* return true;43* }44* });45* // => true46*/47function isEqual(value, other, customizer, thisArg) {48customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;49var result = customizer ? customizer(value, other) : undefined;50return result === undefined ? baseIsEqual(value, other, customizer) : !!result;51}5253module.exports = isEqual;545556