Skip to content

Strict should not allow a trailing slash #112

@posva

Description

@posva

Hello,

First, thanks a lot for creating path-to-repexp, we use it to handle paths in vue-router and it makes things pretty easy 🙂

When using strict: true, a path will only match with a trailing slash:

/foo -> /foo/ but no /foo

but this looks strange because I see no way to force a path not to have a trailing slash

? -> /foo but not /foo/

IMO, it would make more sense to allow the user to force the slash by simply appending it to the route: /foo/ -> /foo/ but not /foo

Now, I know this is a breaking channge but still wanted to know your thoughts about this because I couldn't find any previous issue about the topic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions