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:
@@ -1,12 +1,11 @@
|
||||
import isSymbol from './isSymbol.js';
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295,
|
||||
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
|
||||
const MAX_ARRAY_LENGTH = 4294967295;
|
||||
const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeFloor = Math.floor,
|
||||
nativeMin = Math.min;
|
||||
const nativeFloor = Math.floor, nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
|
||||
@@ -24,20 +23,20 @@ var nativeFloor = Math.floor,
|
||||
function baseSortedIndexBy(array, value, iteratee, retHighest) {
|
||||
value = iteratee(value);
|
||||
|
||||
var low = 0,
|
||||
high = array == null ? 0 : array.length,
|
||||
valIsNaN = value !== value,
|
||||
valIsNull = value === null,
|
||||
valIsSymbol = isSymbol(value),
|
||||
valIsUndefined = value === undefined;
|
||||
let low = 0;
|
||||
let high = array == null ? 0 : array.length;
|
||||
const valIsNaN = value !== value;
|
||||
const valIsNull = value === null;
|
||||
const valIsSymbol = isSymbol(value);
|
||||
const valIsUndefined = value === undefined;
|
||||
|
||||
while (low < high) {
|
||||
var mid = nativeFloor((low + high) / 2),
|
||||
computed = iteratee(array[mid]),
|
||||
othIsDefined = computed !== undefined,
|
||||
othIsNull = computed === null,
|
||||
othIsReflexive = computed === computed,
|
||||
othIsSymbol = isSymbol(computed);
|
||||
const mid = nativeFloor((low + high) / 2);
|
||||
const computed = iteratee(array[mid]);
|
||||
const othIsDefined = computed !== undefined;
|
||||
const othIsNull = computed === null;
|
||||
const othIsReflexive = computed === computed;
|
||||
const othIsSymbol = isSymbol(computed);
|
||||
|
||||
if (valIsNaN) {
|
||||
var setLow = retHighest || othIsReflexive;
|
||||
|
||||
Reference in New Issue
Block a user