From 76f56f451fab037897e0f5c7f72727d4c1e48949 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:31:09 -0600 Subject: [PATCH] style: fewer casts --- src/script.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/script.ts b/src/script.ts index 63dead3..a168794 100644 --- a/src/script.ts +++ b/src/script.ts @@ -215,11 +215,12 @@ async function applySavedProfiles(): Promise { for (let f = 1; f < (profiles[i]?.length ?? 0) + 1; f++) { createCourse(f, i); const roomInput = document.getElementById(`rmnum${f}${i}txt`); - const nameInput = document.getElementById( - `cl${f}${i}txt`, - ) as HTMLInputElement; + const nameInput = document.getElementById(`cl${f}${i}txt`); - if (roomInput instanceof HTMLInputElement) { + if ( + roomInput instanceof HTMLInputElement && + nameInput instanceof HTMLInputElement + ) { const parsedRoom = roomSchema.safeParse(profiles[i]?.[f - 1]?.[0]); if (parsedRoom.success) {