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:
@@ -5,10 +5,10 @@ import baseUnary from './_baseUnary.js';
|
||||
import copyArray from './_copyArray.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
const arrayProto = Array.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var splice = arrayProto.splice;
|
||||
const splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAllBy` without support for iteratee
|
||||
@@ -22,10 +22,11 @@ var splice = arrayProto.splice;
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function basePullAll(array, values, iteratee, comparator) {
|
||||
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
|
||||
index = -1,
|
||||
length = values.length,
|
||||
seen = array;
|
||||
const indexOf = comparator ? baseIndexOfWith : baseIndexOf;
|
||||
const length = values.length;
|
||||
|
||||
let index = -1;
|
||||
let seen = array;
|
||||
|
||||
if (array === values) {
|
||||
values = copyArray(values);
|
||||
@@ -34,9 +35,9 @@ function basePullAll(array, values, iteratee, comparator) {
|
||||
seen = arrayMap(array, baseUnary(iteratee));
|
||||
}
|
||||
while (++index < length) {
|
||||
var fromIndex = 0,
|
||||
value = values[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
let fromIndex = 0;
|
||||
const value = values[index];
|
||||
const computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
|
||||
if (seen !== array) {
|
||||
|
||||
Reference in New Issue
Block a user