Skip to content

Commit

Permalink
replaced let and const with var in _clone.js for consistency (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berndy committed Dec 6, 2023
1 parent 74cfca7 commit 02d610e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions source/internal/_clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function _ObjectMap() {
}

_ObjectMap.prototype.set = function(key, value) {
const hashedKey = this.hash(key);
var hashedKey = this.hash(key);

let bucket = this.map[hashedKey];
var bucket = this.map[hashedKey];
if (!bucket) {
this.map[hashedKey] = bucket = [];
}
Expand All @@ -81,7 +81,7 @@ _ObjectMap.prototype.set = function(key, value) {
};

_ObjectMap.prototype.hash = function(key) {
let hashedKey = [];
var hashedKey = [];
for (var value in key) {
hashedKey.push(Object.prototype.toString.call(key[value]));
}
Expand All @@ -96,25 +96,25 @@ _ObjectMap.prototype.get = function(key) {
*/
if (this.length <= 180) {

for (const p in this.map) {
const bucket = this.map[p];
for (var p in this.map) {
var bucket = this.map[p];

for (let i = 0; i < bucket.length; i += 1) {
const element = bucket[i];
for (var i = 0; i < bucket.length; i += 1) {
var element = bucket[i];
if (element[0] === key) {return element[1];}
}

}
return;
}

const hashedKey = this.hash(key);
const bucket = this.map[hashedKey];
var hashedKey = this.hash(key);
var bucket = this.map[hashedKey];

if (!bucket) {return;}

for (let i = 0; i < bucket.length; i += 1) {
const element = bucket[i];
for (var i = 0; i < bucket.length; i += 1) {
var element = bucket[i];
if (element[0] === key) {return element[1];}
}

Expand Down
2 changes: 1 addition & 1 deletion source/internal/_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function _path(pathAr, obj) {
return undefined;
}

const p = pathAr[i];
var p = pathAr[i];
if (_isInteger(p)) {
val = _nth(p, val);
} else {
Expand Down

0 comments on commit 02d610e

Please sign in to comment.