Stricter search that doesn't ignore all punctuation.
This commit is contained in:
parent
dc4bb494f3
commit
d4e91ea9a6
|
@ -86,7 +86,7 @@ export function haystackFormat(str: string) {
|
||||||
// Preformat search string for faster search
|
// Preformat search string for faster search
|
||||||
export function needleFormat(query: string) {
|
export function needleFormat(query: string) {
|
||||||
const based = query.normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase()
|
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
|
// Test if haystack includes needle
|
||||||
|
|
Loading…
Reference in New Issue
Block a user