Stricter search that doesn't ignore all punctuation.

This commit is contained in:
Leo Vasanko 2023-11-13 13:56:54 +00:00
parent dc4bb494f3
commit d4e91ea9a6

View File

@ -86,7 +86,7 @@ export function haystackFormat(str: string) {
// Preformat search string for faster search
export function needleFormat(query: string) {
const based = query.normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase()
return {based, words: based.split(/\W+/)}
return {based, words: based.split(/\s+/)}
}
// Test if haystack includes needle