From b8fa0bd5d9d1e0224e0634af38236ee321c5eec3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 16 Apr 2021 16:36:54 +0100 Subject: [PATCH] js: Fix two errors reported by ts 4.x templates/script.ts:898:7: error TS7034: Variable 'held' implicitly has type 'any' in some locations where its type cannot be determined. templates/script.ts:954:32: error TS7005: Variable 'held' implicitly has an 'any' type. Reported-by: Matthew Vernon Signed-off-by: Ian Jackson --- templates/script.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index f1f8e0d0..d5c9d309 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -895,7 +895,7 @@ function mouse_find_predicate( predicate: (p: PieceInfo) => boolean ): MouseFindClicked { let clicked: PieceId[]; - let held; + let held: string | null; let pinned = false; let already_count = 0; @@ -932,7 +932,7 @@ function mouse_find_predicate( held = p.held; if (held == us && !allow_for_deselect) held = null; } - if (held == us) { + if (held! == us) { // user is going to be deselecting if (p.held != us) { // skip ones we don't have -- 2.30.2