-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Ability to convert tokens to regex. #52
Comments
@rill-js Great thought and easy enough to expose since that's what is already happening. Just curious, any thoughts on what you'd use it for? Edit: I got the gist, was curious if you had a practical example/use on hand. |
Currently i'm creating a nested router, and the paths need to be merged to their parents as they are created. It would be a bit easier this way since I could just merge arbitrary tokens rather than worrying about repeating segments and "/". More of a convenience really but it would be more efficient than rebuilding and re-parsing each regex every time. Also pretty easy to implement. |
The #parse method returns an array of tokens, it would be cool if we could pass in those tokens to get a regex again.
It would be useful to merge multiple parsed paths.
I could do a PR if anyone else things this is a good idea.
The text was updated successfully, but these errors were encountered: