Apply prefer-const lint rule

This commit is contained in:
Zaid Abdulla committed 2018-08-25 16:14:34 -07:00
1 parent b43088c03c
commit 09e6a360af
26 files changed
+217 -215

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ function generateDeviceId(deviceIdStruct) {
return str.replace(/[^A-Za-z0-9_]/g, chr => {
const buf = Buffer.from(chr, "utf8");
let rep = "";
for (let b of buf) rep += "%" + b.toString(16).toUpperCase();
for (const b of buf) rep += "%" + b.toString(16).toUpperCase();
return rep;
});
}
@@ -139,7 +139,7 @@ function parsePath(pattern, start, res) {
path.alias |= 1 << path.length;
i = parseAlias(pattern, i + 1, path) + 1;
} else {
let j = i;
const j = i;
while (i < pattern.length && pattern[i] !== ":" && pattern[i] !== ".")
++i;
@@ -169,7 +169,7 @@ function addPathMeta(path) {
path.alias = 0;
path.wildcard = 0;
for (let [i, p] of path.entries()) {
for (const [i, p] of path.entries()) {
if (Array.isArray(p)) {
path.alias |= 1 << i;
for (let j = 0; j < p.length; j += 2) addPathMeta(p[j]);