Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / isEqualWith.js
1 var baseIsEqual = require('./internal/baseIsEqual');
2
3 /**
4  * This method is like `_.isEqual` except that it accepts `customizer` which is
5  * invoked to compare values. If `customizer` returns `undefined` comparisons are
6  * handled by the method instead. The `customizer` is invoked with up to six arguments:
7  * (objValue, othValue [, index|key, object, other, stack]).
8  *
9  * @static
10  * @memberOf _
11  * @category Lang
12  * @param {*} value The value to compare.
13  * @param {*} other The other value to compare.
14  * @param {Function} [customizer] The function to customize comparisons.
15  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
16  * @example
17  *
18  * function isGreeting(value) {
19  *   return /^h(?:i|ello)$/.test(value);
20  * }
21  *
22  * function customizer(objValue, othValue) {
23  *   if (isGreeting(objValue) && isGreeting(othValue)) {
24  *     return true;
25  *   }
26  * }
27  *
28  * var array = ['hello', 'goodbye'];
29  * var other = ['hi', 'goodbye'];
30  *
31  * _.isEqualWith(array, other, customizer);
32  * // => true
33  */
34 function isEqualWith(value, other, customizer) {
35   customizer = typeof customizer == 'function' ? customizer : undefined;
36   var result = customizer ? customizer(value, other) : undefined;
37   return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
38 }
39
40 module.exports = isEqualWith;