refactor: update dependencies

This commit is contained in:
2024-04-06 13:32:53 +02:00
parent 854ab6d3be
commit bef51d2a7d
6 changed files with 2784 additions and 3002 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { KEYMAP_CATEGORIES, KEYMAP_CODES } from "$lib/serial/keymap-codes";
import type { KeyInfo } from "$lib/serial/keymap-codes";
import Index from "flexsearch";
import flexsearch from "flexsearch";
import { createEventDispatcher } from "svelte";
import ActionListItem from "$lib/components/ActionListItem.svelte";
import LL from "../../../i18n/i18n-svelte";
@@ -10,7 +10,7 @@
export let currentAction: number | undefined = undefined;
export let nextAction: number | undefined = undefined;
const index = new Index({ tokenize: "full" });
const index = new flexsearch.Index({ tokenize: "full" });
for (const action of Object.values(KEYMAP_CODES)) {
index?.add(
action.code,

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { KEYMAP_CODES } from "$lib/serial/keymap-codes";
import Index from "flexsearch";
import flexsearch from "flexsearch";
import LL from "../../../i18n/i18n-svelte";
import { action } from "$lib/title";
import { onDestroy, onMount, setContext } from "svelte";
@@ -30,8 +30,8 @@
$: searchIndex = $chords?.length > 0 ? buildIndex($chords) : undefined;
function buildIndex(chords: ChordInfo[]): Index {
const index = new Index({ tokenize: "full" });
function buildIndex(chords: ChordInfo[]): flexsearch.Index {
const index = new flexsearch.Index({ tokenize: "full" });
chords.forEach((chord, i) => {
if ("phrase" in chord) {
index.add(