Skip to content

Support named wildcards (PR) #45

Open
@chucksellick

Description

@chucksellick

Firstly - I have already created a pull request for this feature, I realise the contributing guidelines say not to do this, but in my case I needed the feature anyway and am using that build in my routing library: https://github.com/downplay/jarl-react

So, I will not be too concerned if the pull request is ultimately declined, as I will carry on using my fork anyway, but I am opening this issue as it would still be nice to see the functionality in the main package, and am happy to discuss any changes to make this happen. I am also aware that this feature has been mentioned elsewhere and is probably desirable (but maybe you were thinking of different syntax).

The pull request is here: #44

The syntax I have implemented for named wildcards is: /*:path which will capture everything into path instead of _. I chose this syntax because it is unambiguous compared to existing syntax and did not break any existing tests, and I feel the meaning is instantly clear when reading the syntax.

I've added a complete set of tests for the syntax, BUT I did not update any documentation - if discussion is positive then I am happy to also update the docs and add to the pull request.

I look forward to feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions