From c2c2e0b9eadb14b71bf969d2803d0cebb989ce0c Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 May 2024 10:07:58 -0700 Subject: [PATCH] billing/remote_billing_auth: Fix TypeScript noUncheckedIndexedAccess errors. Signed-off-by: Anders Kaseorg --- web/src/billing/remote_billing_auth.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/src/billing/remote_billing_auth.ts b/web/src/billing/remote_billing_auth.ts index 7b25b9d953..fe1355e7f4 100644 --- a/web/src/billing/remote_billing_auth.ts +++ b/web/src/billing/remote_billing_auth.ts @@ -55,13 +55,10 @@ export function initialize(): void { }, showErrors(error_map) { $("*[class$='-error']").hide(); - for (const key in error_map) { - if (Object.prototype.hasOwnProperty.call(error_map, key)) { - const error = error_map[key]; - const $error_element = $(`.${CSS.escape(key)}-error`); - $error_element.text(error); - $error_element.show(); - } + for (const [key, error] of Object.entries(error_map)) { + const $error_element = $(`.${CSS.escape(key)}-error`); + $error_element.text(error); + $error_element.show(); } }, });