mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Ensure equalByTag passing customizer to equalFunc.
This commit is contained in:
@@ -2308,7 +2308,7 @@
|
|||||||
isSameTag = objTag == othTag;
|
isSameTag = objTag == othTag;
|
||||||
|
|
||||||
if (isSameTag && !(objIsArr || objIsObj)) {
|
if (isSameTag && !(objIsArr || objIsObj)) {
|
||||||
return equalByTag(object, other, objTag, equalFunc, bitmask);
|
return equalByTag(object, other, objTag, equalFunc, customizer, bitmask);
|
||||||
}
|
}
|
||||||
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
||||||
if (!isPartial) {
|
if (!isPartial) {
|
||||||
@@ -3757,10 +3757,11 @@
|
|||||||
* @param {Object} other The other object to compare.
|
* @param {Object} other The other object to compare.
|
||||||
* @param {string} tag The `toStringTag` of the objects to compare.
|
* @param {string} tag The `toStringTag` of the objects to compare.
|
||||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||||
|
* @param {Function} [customizer] The function to customize comparisons.
|
||||||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
|
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||||
*/
|
*/
|
||||||
function equalByTag(object, other, tag, equalFunc, bitmask) {
|
function equalByTag(object, other, tag, equalFunc, customizer, bitmask) {
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case boolTag:
|
case boolTag:
|
||||||
case dateTag:
|
case dateTag:
|
||||||
@@ -3789,8 +3790,10 @@
|
|||||||
case setTag:
|
case setTag:
|
||||||
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
||||||
convert || (convert = setToArray);
|
convert || (convert = setToArray);
|
||||||
|
|
||||||
|
// Recursively compare objects (susceptible to call stack limits).
|
||||||
return (isPartial || object.size == other.size) &&
|
return (isPartial || object.size == other.size) &&
|
||||||
equalFunc(convert(object), convert(other), undefined, bitmask | UNORDERED_COMPARE_FLAG);
|
equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user