Open YPCrumble opened 7 years ago
Isn't that easily implemented yourself?
const fuzzy = require('fuzzy');
function filter(input, term) {
const results = fuzzy.filter(input, term);
if (results.length === 0) {
return ['No results found'];
}
return results.map(x => x.string);
}
const list = ['baconing', 'narwhal', 'a mighty bear canoe'];
filter(list, 'bcn');
//=> ['No results found']
I'd like to provide the user with a default option in the event that their search returns no results. Something simple like "No results found" but that can be customized as well. Is that something you'd be interested in a PR for?