mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Apply more let/const transforms.
This commit is contained in:
@@ -6,26 +6,26 @@ import mapToArray from './_mapToArray.js';
|
||||
import setToArray from './_setToArray.js';
|
||||
|
||||
/** Used to compose bitmasks for value comparisons. */
|
||||
var COMPARE_PARTIAL_FLAG = 1,
|
||||
COMPARE_UNORDERED_FLAG = 2;
|
||||
const COMPARE_PARTIAL_FLAG = 1;
|
||||
const COMPARE_UNORDERED_FLAG = 2;
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var boolTag = '[object Boolean]',
|
||||
dateTag = '[object Date]',
|
||||
errorTag = '[object Error]',
|
||||
mapTag = '[object Map]',
|
||||
numberTag = '[object Number]',
|
||||
regexpTag = '[object RegExp]',
|
||||
setTag = '[object Set]',
|
||||
stringTag = '[object String]',
|
||||
symbolTag = '[object Symbol]';
|
||||
const boolTag = '[object Boolean]';
|
||||
const dateTag = '[object Date]';
|
||||
const errorTag = '[object Error]';
|
||||
const mapTag = '[object Map]';
|
||||
const numberTag = '[object Number]';
|
||||
const regexpTag = '[object RegExp]';
|
||||
const setTag = '[object Set]';
|
||||
const stringTag = '[object String]';
|
||||
const symbolTag = '[object Symbol]';
|
||||
|
||||
var arrayBufferTag = '[object ArrayBuffer]',
|
||||
dataViewTag = '[object DataView]';
|
||||
const arrayBufferTag = '[object ArrayBuffer]';
|
||||
const dataViewTag = '[object DataView]';
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
||||
const symbolProto = Symbol ? Symbol.prototype : undefined;
|
||||
const symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
||||
|
||||
/**
|
||||
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
||||
@@ -79,17 +79,17 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
||||
return object == `${ other }`;
|
||||
|
||||
case mapTag:
|
||||
var convert = mapToArray;
|
||||
let convert = mapToArray;
|
||||
|
||||
case setTag:
|
||||
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
||||
const isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
||||
convert || (convert = setToArray);
|
||||
|
||||
if (object.size != other.size && !isPartial) {
|
||||
return false;
|
||||
}
|
||||
// Assume cyclic values are equal.
|
||||
var stacked = stack.get(object);
|
||||
const stacked = stack.get(object);
|
||||
if (stacked) {
|
||||
return stacked == other;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
||||
|
||||
// Recursively compare objects (susceptible to call stack limits).
|
||||
stack.set(object, other);
|
||||
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
||||
const result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
||||
stack['delete'](object);
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user