Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var baseIsEqualDeep = require('./baseIsEqualDeep'),
2
isObject = require('../lang/isObject'),
3
isObjectLike = require('./isObjectLike');
4
5
/**
6
* The base implementation of `_.isEqual` without support for `this` binding
7
* `customizer` functions.
8
*
9
* @private
10
* @param {*} value The value to compare.
11
* @param {*} other The other value to compare.
12
* @param {Function} [customizer] The function to customize comparing values.
13
* @param {boolean} [isLoose] Specify performing partial comparisons.
14
* @param {Array} [stackA] Tracks traversed `value` objects.
15
* @param {Array} [stackB] Tracks traversed `other` objects.
16
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
17
*/
18
function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
19
if (value === other) {
20
return true;
21
}
22
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
23
return value !== value && other !== other;
24
}
25
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
26
}
27
28
module.exports = baseIsEqual;
29
30