From 73ea1fc8a03729367382f44d22dba5569ac013ca Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 10 Apr 2021 18:08:36 -0500 Subject: [PATCH] Add fuzzyMatchesWholeWord --- helpers/matching.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/matching.js b/helpers/matching.js index 3e56031..3894a47 100644 --- a/helpers/matching.js +++ b/helpers/matching.js @@ -4,6 +4,9 @@ export function matchesWholeWord (needle, 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) { // Make strings lowercase for more generous comparison