-
Notifications
You must be signed in to change notification settings - Fork 17
lab-davidw-33 #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
lab-davidw-33 #31
Conversation
|
||
module.exports = function() { | ||
return function(galleries, searchTerm) { | ||
if(!searchTerm) return /.*/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if no search term is given, wouldn't you want to return all the gallaries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like this the way it is. I thought I was setting it to be wild carded for all possible characters, and therefore all galleries. Am I mistaken?
return function(galleries, searchTerm) { | ||
if(!searchTerm) return /.*/; | ||
|
||
let pattern = `.*${searchTerm.toUpperCase().split('').join('.*')}.*`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work with this logic!
No description provided.