feat: enable stricter type checking options

feat: make the app more fault tolerant
This commit is contained in:
2024-04-06 14:28:23 +02:00
parent bef51d2a7d
commit 2808973ad0
38 changed files with 152 additions and 121 deletions

View File

@@ -37,7 +37,7 @@
index.add(
i,
chord.phrase
.map((it) => KEYMAP_CODES[it]?.id)
.map((it) => KEYMAP_CODES.get(it)?.id)
.filter((it) => !!it)
.join(""),
);
@@ -51,7 +51,9 @@
function search(event: Event) {
const query = (event.target as HTMLInputElement).value;
searchFilter.set(
query && searchIndex ? searchIndex.search(query) : undefined,
query && searchIndex
? (searchIndex.search(query) as number[])
: undefined,
);
page = 0;
}
@@ -131,10 +133,12 @@
>
{/if}
{#if $lastPage !== -1}
{#each $items.slice(page * $pageSize - (page === 0 ? 0 : 1), (page + 1) * $pageSize - 1) as [chord] (JSON.stringify(chord.id))}
<tr>
<ChordEdit {chord} />
</tr>
{#each $items.slice(page * $pageSize - (page === 0 ? 0 : 1), (page + 1) * $pageSize - 1) as [chord] (JSON.stringify(chord?.id))}
{#if chord}
<tr>
<ChordEdit {chord} />
</tr>
{/if}
{/each}
{:else}
<caption>{$LL.configure.chords.search.NO_RESULTS()}</caption>