From 922fdedde9146f742b9cb7613a587508c5047246 Mon Sep 17 00:00:00 2001 From: felix-hoc Date: Fri, 20 Dec 2024 16:38:50 +0100 Subject: [PATCH] Fix linting error replace for..in loop --- src/ts/components/listselector.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ts/components/listselector.ts b/src/ts/components/listselector.ts index c8157295a..dc7535bda 100644 --- a/src/ts/components/listselector.ts +++ b/src/ts/components/listselector.ts @@ -77,12 +77,7 @@ export abstract class ListSelector extends Co } private getItemIndex(key: string): number { - for (let index in this.items) { - if (key === this.items[index].key) { - return parseInt(index); - } - } - return -1; + return this.items.findIndex((item) => item.key === key); } /**