Add fuzzyMatchesWholeWord

This commit is contained in:
Sam Carlton 2021-04-10 18:08:36 -05:00
parent 39977a4646
commit 73ea1fc8a0

View file

@ -4,6 +4,9 @@ export function matchesWholeWord (needle, haystack) {
return new RegExp('\\b' + needle + '\\b').test(haystack) return new RegExp('\\b' + needle + '\\b').test(haystack)
} }
export function fuzzyMatchesWholeWord (needle, haystack) {
return matchesWholeWord ( needle.toLowerCase() , haystack.toLowerCase() )
}
export function eitherMatches (stringARaw, stringBRaw) { export function eitherMatches (stringARaw, stringBRaw) {
// Make strings lowercase for more generous comparison // Make strings lowercase for more generous comparison