mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Bump to v4.17.0.
This commit is contained in:
@@ -5,9 +5,9 @@ import equalArrays from './_equalArrays.js';
|
||||
import mapToArray from './_mapToArray.js';
|
||||
import setToArray from './_setToArray.js';
|
||||
|
||||
/** Used to compose bitmasks for comparison styles. */
|
||||
var UNORDERED_COMPARE_FLAG = 1,
|
||||
PARTIAL_COMPARE_FLAG = 2;
|
||||
/** Used to compose bitmasks for value comparisons. */
|
||||
var COMPARE_PARTIAL_FLAG = 1,
|
||||
COMPARE_UNORDERED_FLAG = 2;
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var boolTag = '[object Boolean]',
|
||||
@@ -38,14 +38,13 @@ var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
* @param {Object} object The object to compare.
|
||||
* @param {Object} other The other object to compare.
|
||||
* @param {string} tag The `toStringTag` of the objects to compare.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
||||
* @param {Function} customizer The function to customize comparisons.
|
||||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
|
||||
* for more details.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
||||
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
||||
switch (tag) {
|
||||
case dataViewTag:
|
||||
if ((object.byteLength != other.byteLength) ||
|
||||
@@ -83,7 +82,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
||||
var convert = mapToArray;
|
||||
|
||||
case setTag:
|
||||
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
||||
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
||||
convert || (convert = setToArray);
|
||||
|
||||
if (object.size != other.size && !isPartial) {
|
||||
@@ -94,11 +93,11 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
||||
if (stacked) {
|
||||
return stacked == other;
|
||||
}
|
||||
bitmask |= UNORDERED_COMPARE_FLAG;
|
||||
bitmask |= COMPARE_UNORDERED_FLAG;
|
||||
|
||||
// Recursively compare objects (susceptible to call stack limits).
|
||||
stack.set(object, other);
|
||||
var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
|
||||
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
||||
stack['delete'](object);
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user