Skip to content

Commit

Permalink
Merge pull request #60 from reg-viz/refactor/improve-filter
Browse files Browse the repository at this point in the history
refactor: improve fuse.js options
  • Loading branch information
wadackel committed Apr 28, 2024
2 parents b01dfeb + 433a31a commit 0f50c46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/worker-main.ts
Expand Up @@ -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);
Expand Down

0 comments on commit 0f50c46

Please sign in to comment.