Closed anuragsoni closed 3 years ago
@tsnobip @woeps Maybe this will help you define nested routes with wildcards? This needs more work but maybe this initial diff can be of help if you are exploring the routes internals.
This might be just enough of what I needed for nested routing in react apps. :partying_face: Thanks a lot!
One thing I observed: Parts.prefix
and Parts.wildcard_match
doesn't return the string with a leading slash, which I needed.
@woeps One thing I observed:
Parts.prefix
andParts.wildcard_match
doesn't return the string with a leading slash, which I needed.
Good catch! There need to be some more refinements before this can be considered ready. Leading slash should indeed be present when a user gets a readable output out of a wildcard. I'll keep this in mind. Thanks!
sprintf
Todo:
Work on naming. Wildcard/Parts etc could be confusing for new users(push this for now)Constructing wildcards from user provided patterns should perform some sanity checks and return an error if the input is malformed (we should do this for the(for a future PR)match'
function too probably)