I use fuzzy on a backend project where the pattern and the arr are sometimes undefined or empty. Thought it'll be good to have some error handling and fallbacks. Without it, when you pass undefined, it breaks:
# When pattern is undefined
TypeError: Cannot read property 'toLowerCase' of undefined`
# When arr is undefined
TypeError: Cannot read property 'reduce' of undefined
I use fuzzy on a backend project where the
pattern
and thearr
are sometimesundefined
or empty. Thought it'll be good to have some error handling and fallbacks. Without it, when you passundefined
, it breaks: