From 5974d4d6885dd5e4b6c4c3c85a7c3f0eb1e1c226 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 26 Feb 2023 09:58:16 -0600 Subject: == -> === in some more files --- frontend/src/ts/popups/word-filter-popup.ts | 6 +++--- frontend/src/ts/settings/theme-picker.ts | 2 +- frontend/src/ts/states/connection.ts | 4 ++-- frontend/src/ts/test/caret.ts | 4 ++-- frontend/src/ts/test/focus.ts | 4 ++-- frontend/src/ts/test/layout-emulator.ts | 2 +- frontend/src/ts/test/monkey.ts | 4 ++-- frontend/src/ts/test/pace-caret.ts | 2 +- frontend/src/ts/test/poetry.ts | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/ts/popups/word-filter-popup.ts b/frontend/src/ts/popups/word-filter-popup.ts index 0c2b95d09..04aabebdb 100644 --- a/frontend/src/ts/popups/word-filter-popup.ts +++ b/frontend/src/ts/popups/word-filter-popup.ts @@ -232,12 +232,12 @@ async function filter(language: string): Promise { const minLengthInput = $("#wordFilterPopup .wordMinInput").val() as string; let maxLength; let minLength; - if (maxLengthInput == "") { + if (maxLengthInput === undefined || maxLengthInput === "") { maxLength = 999; } else { maxLength = parseInt(maxLengthInput); } - if (minLengthInput == "") { + if (maxLengthInput === undefined || minLengthInput === "") { minLength = 1; } else { minLength = parseInt(minLengthInput); @@ -247,7 +247,7 @@ async function filter(language: string): Promise { const test1 = regincl.test(word); const test2 = regexcl.test(word); if ( - ((test1 && !test2) || (test1 && filterout == "")) && + ((test1 && !test2) || (test1 && filterout === "")) && word.length <= maxLength && word.length >= minLength ) { diff --git a/frontend/src/ts/settings/theme-picker.ts b/frontend/src/ts/settings/theme-picker.ts index 0ce28cc35..bd97d846d 100644 --- a/frontend/src/ts/settings/theme-picker.ts +++ b/frontend/src/ts/settings/theme-picker.ts @@ -334,7 +334,7 @@ $(".pageSettings .section.themes .tabs .button").on("click", (e) => { $target.addClass("active"); // setCustomInputs(); //test - if ($target.attr("tab") == "preset") { + if ($target.attr("tab") === "preset") { UpdateConfig.setCustomTheme(false); } else { UpdateConfig.setCustomTheme(true); diff --git a/frontend/src/ts/states/connection.ts b/frontend/src/ts/states/connection.ts index 017a3d178..b89adebb5 100644 --- a/frontend/src/ts/states/connection.ts +++ b/frontend/src/ts/states/connection.ts @@ -10,7 +10,7 @@ export function get(): boolean { let noInternetBannerId: number | undefined = undefined; function showBanner(): void { - if (noInternetBannerId == undefined) { + if (noInternetBannerId === undefined) { noInternetBannerId = Notifications.addBanner( "No internet connection", 0, @@ -24,7 +24,7 @@ ConnectionEvent.subscribe((newState) => { state = newState; if (state) { Notifications.add("You're back online", 1, 3, "Connection"); - if (noInternetBannerId != undefined) { + if (noInternetBannerId !== undefined) { $( `#bannerCenter .banner[id="${noInternetBannerId}"] .closeButton` ).trigger("click"); diff --git a/frontend/src/ts/test/caret.ts b/frontend/src/ts/test/caret.ts index 4708d8861..edd7d096a 100644 --- a/frontend/src/ts/test/caret.ts +++ b/frontend/src/ts/test/caret.ts @@ -42,7 +42,7 @@ export async function updatePosition(): Promise { const inputLen = TestInput.input.current.length; const currentLetterIndex = inputLen; //insert temporary character so the caret will work in zen mode - const activeWordEmpty = $("#words .active").children().length == 0; + const activeWordEmpty = $("#words .active").children().length === 0; if (activeWordEmpty) { $("#words .active").append('_'); } @@ -87,7 +87,7 @@ export async function updatePosition(): Promise { if (Config.tapeMode === "letter") { newLeft = wordsWrapperWidth / 2 - (fullWidthCaret ? 0 : caretWidth / 2); } else if (Config.tapeMode === "word") { - if (inputLen == 0) { + if (inputLen === 0) { newLeft = wordsWrapperWidth / 2 - (fullWidthCaret ? 0 : caretWidth / 2); } else { let inputWidth = 0; diff --git a/frontend/src/ts/test/focus.ts b/frontend/src/ts/test/focus.ts index aa52a8d4f..ecbee6405 100644 --- a/frontend/src/ts/test/focus.ts +++ b/frontend/src/ts/test/focus.ts @@ -52,8 +52,8 @@ export function set(foc: boolean, withCursor = false): void { $(document).on("mousemove", function (event) { if (!state) return; - if (ActivePage.get() == "loading") return; - if (ActivePage.get() == "account" && state == true) return; + if (ActivePage.get() === "loading") return; + if (ActivePage.get() === "account" && state === true) return; if ( event.originalEvent && // To avoid mouse/desk vibration from creating a flashy effect, we'll unfocus @ >5px instead of >0px diff --git a/frontend/src/ts/test/layout-emulator.ts b/frontend/src/ts/test/layout-emulator.ts index 443c7ac06..a74170f75 100644 --- a/frontend/src/ts/test/layout-emulator.ts +++ b/frontend/src/ts/test/layout-emulator.ts @@ -194,7 +194,7 @@ export async function getCharFromEvent( let mapIndex = null; for (let i = 0; i < keyEventCodes.length; i++) { - if (event.code == keyEventCodes[i]) { + if (event.code === keyEventCodes[i]) { mapIndex = i; } } diff --git a/frontend/src/ts/test/monkey.ts b/frontend/src/ts/test/monkey.ts index 781d54a87..bb09796ce 100644 --- a/frontend/src/ts/test/monkey.ts +++ b/frontend/src/ts/test/monkey.ts @@ -66,13 +66,13 @@ export function updateFastOpacity(num: number): void { const opacity = mapRange(num, 130, 180, 0, 1); $("#monkey .fast").animate({ opacity: opacity }, 1000); let animDuration = mapRange(num, 130, 180, 0.25, 0.01); - if (animDuration == 0.25) animDuration = 0; + if (animDuration === 0.25) animDuration = 0; $("#monkey").css({ animationDuration: animDuration + "s" }); } export function type(): void { if (!Config.monkey) return; - if (!left && last == "right") { + if (!left && last === "right") { left = true; last = "left"; } else if (!right) { diff --git a/frontend/src/ts/test/pace-caret.ts b/frontend/src/ts/test/pace-caret.ts index e894d6785..ed5e932ca 100644 --- a/frontend/src/ts/test/pace-caret.ts +++ b/frontend/src/ts/test/pace-caret.ts @@ -86,7 +86,7 @@ export async function init(): Promise { wpm = Math.round(wpm); } else if (Config.paceCaret === "custom") { wpm = Config.paceCaretCustomSpeed; - } else if (Config.paceCaret === "last" || TestState.isPaceRepeat == true) { + } else if (Config.paceCaret === "last" || TestState.isPaceRepeat) { wpm = TestStats.lastTestWpm; } if (wpm === undefined || wpm < 1 || Number.isNaN(wpm)) { diff --git a/frontend/src/ts/test/poetry.ts b/frontend/src/ts/test/poetry.ts index f8a5d5bd7..15f586eb5 100644 --- a/frontend/src/ts/test/poetry.ts +++ b/frontend/src/ts/test/poetry.ts @@ -26,12 +26,12 @@ export class Poem extends Section { } } - if (scrubbed == "") continue; + if (scrubbed === "") continue; scrubbedWords.push(scrubbed); count++; - if (count == maxWords) break; + if (count === maxWords) break; } this.words = scrubbedWords; -- cgit v1.2.3