-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
What is the difference between matcher and filter? #40
Comments
I can't speak to why both needed to be provided in the API, but here's the difference as far as I can tell:
|
Yeah, the differences that @es128 pointed out are correct, but I've thought about removing filter. Maybe we can allow |
That sounds good, less confusing. In the mean time, do I understand correctly that |
What's the use case? might be easier to give good feedback based on what you're trying to accomplish. |
The
Does the function I get back from |
it should, yes. see these unit tests for examples |
closing since it's not technically an issue. feel free to continue the conversation or open a new issue if a new topic pops up |
This might be a documentation issue, or maybe I'm being stupid.
The readme says that .matcher(pattern) gets you a function that you can use to match paths. I'm assuming this means it returns true/false, in which case it sounds like it could be used as an array filter function.
But then there seems to be another method for this exact purpose, .filter(): "Returns a function that can be passed to
Array#filter()
." I don't get it. Can't the returned function from .matcher be used in this way?What's the difference?
The text was updated successfully, but these errors were encountered: