aboutsummaryrefslogtreecommitdiff
path: root/library/client/lib/search.ts
diff options
context:
space:
mode:
authorJoris Guyonvarch2025-12-26 18:41:26 +0100
committerJoris Guyonvarch2025-12-27 20:41:44 +0100
commita110c200e86d2325af07167531fac0f61d9681a0 (patch)
tree90e843f915a2e153ba735849afd83710d90560bf /library/client/lib/search.ts
parenta26d92ad5055fa057647158eb79511e7b1841162 (diff)
Switch to GUI to manage the library
Allow to regroup the CLI and the view into one unique tool.
Diffstat (limited to 'library/client/lib/search.ts')
-rw-r--r--library/client/lib/search.ts17
1 files changed, 0 insertions, 17 deletions
diff --git a/library/client/lib/search.ts b/library/client/lib/search.ts
deleted file mode 100644
index 026cb94..0000000
--- a/library/client/lib/search.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export function match(search: string, ...targets: Array<string | undefined>): boolean {
- const formattedTargets = targets
- .filter(t => t !== undefined)
- .map(format)
-
- return search.split(/\s+/).every(subSearch =>
- formattedTargets.some(target => target.includes(format(subSearch)))
- )
-}
-
-export function format(str: string): string {
- return unaccent(str.toLowerCase())
-}
-
-function unaccent(str: string): string {
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
-}