Skip to content

Commit

Permalink
Fix linting error
Browse files Browse the repository at this point in the history
replace for..in loop
  • Loading branch information
felix-hoc committed Dec 20, 2024
1 parent 119bb1b commit 922fded
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/ts/components/listselector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ export abstract class ListSelector<Config extends ListSelectorConfig> 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);
}

/**
Expand Down

0 comments on commit 922fded

Please sign in to comment.