mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Apply more let/const transforms.
This commit is contained in:
15
_baseSet.js
15
_baseSet.js
@@ -20,17 +20,18 @@ function baseSet(object, path, value, customizer) {
|
||||
}
|
||||
path = castPath(path, object);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
lastIndex = length - 1,
|
||||
nested = object;
|
||||
const length = path.length;
|
||||
const lastIndex = length - 1;
|
||||
|
||||
let index = -1;
|
||||
let nested = object;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = toKey(path[index]),
|
||||
newValue = value;
|
||||
const key = toKey(path[index]);
|
||||
let newValue = value;
|
||||
|
||||
if (index != lastIndex) {
|
||||
var objValue = nested[key];
|
||||
const objValue = nested[key];
|
||||
newValue = customizer ? customizer(objValue, key, nested) : undefined;
|
||||
if (newValue === undefined) {
|
||||
newValue = isObject(objValue)
|
||||
|
||||
Reference in New Issue
Block a user