Skip to content

Commit

Permalink
perf(frontend): simplify the search by keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
jmiguelv committed Jul 10, 2024
1 parent 17ee131 commit 94b4a09
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,14 @@
return;
}
inscriptions = data.corpus.filter((inscription) => {
return (
!keywords ||
keywords
.split(' ')
.map((keyword) => keyword.toLowerCase())
.every((keyword) =>
inscription.keywords.some((/** @type string */ k) => k.includes(keyword))
)
);
});
inscriptions = data.corpus.filter((inscription) =>
keywords
.split(' ')
.map((keyword) => keyword.toLowerCase())
.every((keyword) =>
inscription.keywords.some((/** @type string */ k) => k.includes(keyword))
)
);
}
function loadMore() {
Expand Down

0 comments on commit 94b4a09

Please sign in to comment.