From 433a31a9e5d7ac1320f453679badf69cabba4927 Mon Sep 17 00:00:00 2001 From: wadackel Date: Sun, 28 Apr 2024 18:38:17 +0900 Subject: [PATCH] refactor: improve fuse.js options --- src/worker-main.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/worker-main.ts b/src/worker-main.ts index f21e13e..ad07ca8 100644 --- a/src/worker-main.ts +++ b/src/worker-main.ts @@ -80,9 +80,14 @@ const filter = ({ const search = (entities: RegEntity[]) => { const fuse = new Fuse(entities, { + shouldSort: false, isCaseSensitive: false, + findAllMatches: true, + location: 0, + distance: 100, + minMatchCharLength: 1, + threshold: 0.2, keys: ['name'], - threshold: 0.3, }); return fuse.search(input).map(({ item }) => item);