-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
function validateInput(query) {
return query.replace(/[^a-z]/gi, '');
}
function makeRegExp(input) {
return new RegExp('^' + input, 'i');
}
function match(list, regex) {
return list.filter(function(word) { return regex.test(word); });
}These are great! :) We used methods like these throughout our project but didn't think to wrap them in functions, nice :)
Perhaps put these into a 'helpers.js' file and require it in to files that need it?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels