-
Notifications
You must be signed in to change notification settings - Fork 5
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
Leading wildcards don't work #8
Comments
I think this should be made to work, so I'll try and get time to implement it sometime soon. PR's are also gratefully accepted :) |
This is pretty old - but just wanted to note that |
Regarding @floatingLomas question, your example is wrong because the leading full stop, the first character, is missing in
The According to Wikipedia:
What means, this library is incorrect conceptually, treating wildcard character as at least one character instead of zero or more characters. You see? Try running this on RunKit. We need a new wildcard library with a correct algorithm (or this one fixed). |
https://github.com/Dash-OS/redux-saga-process/blob/master/src/lib/wildcard.js I largely re-created wildcard in the redux-saga-process code provided @revelt might find something useful |
@bradennapier dude you should publish it as a standalone lib on npm! Will check it out right now. I prefer standalone libraries from npm because they're self-contained, with unit tests and API documentation. I can help you to publish it and add you to maintainers if you want. What do you think? |
Considered it, not 100% sure what I even did there honestly - redux-saga-process is a npm library but obviously the wildcard is not. It's meant to take an object with wildcards and filter it for redux patterns. static actionRoutes = {
'*Probe': 'probe'
}; |
@revelt One of the main issues I had is most of them were requiring node whereas I needed it to work in the browser. |
https://github.com/Dash-OS/redux-saga-process/blob/master/src/lib/reducerGenerators.js#L30-L41 You can see it being used there |
Thank you. That's quite an advanced level of JS by the way. I'm thinking how I'd write this from scratch, with bunch |
Notes for posterity no.1.I switched to another library to match strings with wildcards, matcher. It does the job well and supports the leading wildcards out of the box. Notes for posterity no.2.Another string wildcard library, wildstring also has this very same issue with leading wildcards, so don't waste your time with it either. Stick with matcher. |
@revelt heh yeah I like to try to write things as efficient as possible. It's EXTREMELY performant when you run it. Would be interesting to test it against matcher. Looks like a simple enough library and a good choice overall though. |
Apologies for letting this one slip folks. I'll add a note that people should definitely consider using |
Fixed by #11 - also added a note to the README directing people to |
*.foo.com
does not matchfoo.com
; however, I can get it to do so by reversing both strings.Is this expected behaviour?
The text was updated successfully, but these errors were encountered: