* A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to co
(object, other, bitmask, customizer, equalFunc, stack)
| 13717 | * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| 13718 | */ |
| 13719 | function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { |
| 13720 | var objIsArr = isArray(object), |
| 13721 | othIsArr = isArray(other), |
| 13722 | objTag = objIsArr ? arrayTag : getTag(object), |
| 13723 | othTag = othIsArr ? arrayTag : getTag(other); |
| 13724 | |
| 13725 | objTag = objTag == argsTag ? objectTag : objTag; |
| 13726 | othTag = othTag == argsTag ? objectTag : othTag; |
| 13727 | |
| 13728 | var objIsObj = objTag == objectTag, |
| 13729 | othIsObj = othTag == objectTag, |
| 13730 | isSameTag = objTag == othTag; |
| 13731 | |
| 13732 | if (isSameTag && isBuffer(object)) { |
| 13733 | if (!isBuffer(other)) { |
| 13734 | return false; |
| 13735 | } |
| 13736 | objIsArr = true; |
| 13737 | objIsObj = false; |
| 13738 | } |
| 13739 | if (isSameTag && !objIsObj) { |
| 13740 | stack || (stack = new Stack); |
| 13741 | return (objIsArr || isTypedArray(object)) |
| 13742 | ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) |
| 13743 | : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); |
| 13744 | } |
| 13745 | if (!(bitmask & COMPARE_PARTIAL_FLAG)) { |
| 13746 | var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), |
| 13747 | othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); |
| 13748 | |
| 13749 | if (objIsWrapped || othIsWrapped) { |
| 13750 | var objUnwrapped = objIsWrapped ? object.value() : object, |
| 13751 | othUnwrapped = othIsWrapped ? other.value() : other; |
| 13752 | |
| 13753 | stack || (stack = new Stack); |
| 13754 | return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); |
| 13755 | } |
| 13756 | } |
| 13757 | if (!isSameTag) { |
| 13758 | return false; |
| 13759 | } |
| 13760 | stack || (stack = new Stack); |
| 13761 | return equalObjects(object, other, bitmask, customizer, equalFunc, stack); |
| 13762 | } |
| 13763 | |
| 13764 | module.exports = baseIsEqualDeep; |
| 13765 |
no test coverage detected
searching dependent graphs…