mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Apply more let/const transforms.
This commit is contained in:
@@ -8,18 +8,18 @@ import isBuffer from './isBuffer.js';
|
||||
import isTypedArray from './isTypedArray.js';
|
||||
|
||||
/** Used to compose bitmasks for value comparisons. */
|
||||
var COMPARE_PARTIAL_FLAG = 1;
|
||||
const COMPARE_PARTIAL_FLAG = 1;
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var argsTag = '[object Arguments]',
|
||||
arrayTag = '[object Array]',
|
||||
objectTag = '[object Object]';
|
||||
const argsTag = '[object Arguments]';
|
||||
const arrayTag = '[object Array]';
|
||||
const objectTag = '[object Object]';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
||||
@@ -36,17 +36,17 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
||||
var objIsArr = isArray(object),
|
||||
othIsArr = isArray(other),
|
||||
objTag = objIsArr ? arrayTag : getTag(object),
|
||||
othTag = othIsArr ? arrayTag : getTag(other);
|
||||
let objIsArr = isArray(object);
|
||||
const othIsArr = isArray(other);
|
||||
let objTag = objIsArr ? arrayTag : getTag(object);
|
||||
let othTag = othIsArr ? arrayTag : getTag(other);
|
||||
|
||||
objTag = objTag == argsTag ? objectTag : objTag;
|
||||
othTag = othTag == argsTag ? objectTag : othTag;
|
||||
|
||||
var objIsObj = objTag == objectTag,
|
||||
othIsObj = othTag == objectTag,
|
||||
isSameTag = objTag == othTag;
|
||||
let objIsObj = objTag == objectTag;
|
||||
const othIsObj = othTag == objectTag;
|
||||
const isSameTag = objTag == othTag;
|
||||
|
||||
if (isSameTag && isBuffer(object)) {
|
||||
if (!isBuffer(other)) {
|
||||
@@ -62,12 +62,12 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
||||
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
||||
}
|
||||
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
||||
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
||||
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
||||
const objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__');
|
||||
const othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
||||
|
||||
if (objIsWrapped || othIsWrapped) {
|
||||
var objUnwrapped = objIsWrapped ? object.value() : object,
|
||||
othUnwrapped = othIsWrapped ? other.value() : other;
|
||||
const objUnwrapped = objIsWrapped ? object.value() : object;
|
||||
const othUnwrapped = othIsWrapped ? other.value() : other;
|
||||
|
||||
stack || (stack = new Stack);
|
||||
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
||||
|
||||
Reference in New Issue
Block a user