Replace lets with const where possible (#35)

This commit is contained in:
Evan Simkowitz
2024-06-11 13:19:29 -07:00
committed by GitHub
parent 97ca430884
commit 92dc82967c
5 changed files with 33 additions and 40 deletions
+7 -7
View File
@@ -61,11 +61,11 @@ function loadFiraCodeFont() {
return;
}
isFiraCodeLoaded = true;
let firaCodeRegular = new FontFace("Fira Code", "url('/fonts/firacode-regular.woff2')", {
const firaCodeRegular = new FontFace("Fira Code", "url('/fonts/firacode-regular.woff2')", {
style: "normal",
weight: "400",
});
let firaCodeBold = new FontFace("Fira Code", "url('/fonts/firacode-bold.woff2')", {
const firaCodeBold = new FontFace("Fira Code", "url('/fonts/firacode-bold.woff2')", {
style: "normal",
weight: "700",
});
@@ -80,19 +80,19 @@ function loadHackFont() {
return;
}
isHackFontLoaded = true;
let hackRegular = new FontFace("Hack", "url('/fonts/hack-regular.woff2')", {
const hackRegular = new FontFace("Hack", "url('/fonts/hack-regular.woff2')", {
style: "normal",
weight: "400",
});
let hackBold = new FontFace("Hack", "url('/fonts/hack-bold.woff2')", {
const hackBold = new FontFace("Hack", "url('/fonts/hack-bold.woff2')", {
style: "normal",
weight: "700",
});
let hackItalic = new FontFace("Hack", "url('/fonts/hack-italic.woff2')", {
const hackItalic = new FontFace("Hack", "url('/fonts/hack-italic.woff2')", {
style: "italic",
weight: "400",
});
let hackBoldItalic = new FontFace("Hack", "url('/fonts/hack-bolditalic.woff2')", {
const hackBoldItalic = new FontFace("Hack", "url('/fonts/hack-bolditalic.woff2')", {
style: "italic",
weight: "700",
});
@@ -111,7 +111,7 @@ function loadBaseFonts() {
return;
}
isBaseFontsLoaded = true;
let mmFont = new FontFace("Martian Mono", "url(/fonts/MartianMono-VariableFont_wdth,wght.ttf)", {
const mmFont = new FontFace("Martian Mono", "url(/fonts/MartianMono-VariableFont_wdth,wght.ttf)", {
style: "normal",
weight: "normal",
});
+4 -4
View File
@@ -13,7 +13,7 @@ function formatPath(path: PathType): string {
return "$";
}
let pathStr = "$";
for (let pathPart of path) {
for (const pathPart of path) {
if (typeof pathPart === "string") {
if (simplePathStrRe.test(pathPart)) {
pathStr += "." + pathPart;
@@ -39,7 +39,7 @@ function isObject(obj: any): boolean {
function getPath(obj: any, path: PathType): any {
let cur = obj;
for (let pathPart of path) {
for (const pathPart of path) {
if (cur == null) {
return null;
}
@@ -86,7 +86,7 @@ function checkPath(path: PathType): boolean {
if (!isArray(path)) {
return false;
}
for (let pathPart of path) {
for (const pathPart of path) {
if (typeof pathPart !== "string" && typeof pathPart !== "number") {
return false;
}
@@ -118,7 +118,7 @@ function isEmpty(obj: any): boolean {
return obj.length == 0;
}
if (isObject(obj)) {
for (let key in obj) {
for (const _ in obj) {
return false;
}
return true;