| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 1 | var baseIsEqualDeep = require('./_baseIsEqualDeep'), |
| 2 | isObjectLike = require('./isObjectLike'); |
| 3 | |
| 4 | /** |
| 5 | * The base implementation of `_.isEqual` which supports partial comparisons |
| 6 | * and tracks traversed objects. |
| 7 | * |
| 8 | * @private |
| 9 | * @param {*} value The value to compare. |
| 10 | * @param {*} other The other value to compare. |
| 11 | * @param {boolean} bitmask The bitmask flags. |
| 12 | * 1 - Unordered comparison |
| 13 | * 2 - Partial comparison |
| 14 | * @param {Function} [customizer] The function to customize comparisons. |
| 15 | * @param {Object} [stack] Tracks traversed `value` and `other` objects. |
| 16 | * @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
| 17 | */ |
| 18 | function baseIsEqual(value, other, bitmask, customizer, stack) { |
| 19 | if (value === other) { |
| 20 | return true; |
| 21 | } |
| 22 | if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { |
| 23 | return value !== value && other !== other; |
| 24 | } |
| 25 | return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); |
| 26 | } |
| 27 | |
| 28 | module.exports = baseIsEqual; |