-
-
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
Major changes #114
Major changes #114
Conversation
d94a276
to
a508701
Compare
d3e8eb7
to
8a6dab4
Compare
* New option! Ability to set `endsWith` to match paths like `/test?query=string` and ignore the query string * New option! Set `delimiters` for only specific characters to be treated as parameter prefixes (e.g. `/:test`) * Remove `isarray` * Explicitly handle trailing delimiters instead of trimming them (e.g. `/test/` is now treated as `/test/` instead of `/test` when matching) * Remove overloaded `keys` argument that accepts `options` * Remove `keys` list attached to the `RegExp` output * Remove asterisk functionality (it's a real pain to properly encode) * Change `tokensToFunction` (e.g. `compile`) to accept an `encode` function for pretty encoding (e.g. pass your own implementation)
1 similar comment
How should we handle this feature now? |
@oliviertassinari Did you try the README? https://github.com/pillarjs/path-to-regexp#compatibility-with-express--4x. It's been this for a while, I only hacked the asterisk feature into the 1.x releases around 1.2, but realised that making it act like it use used in Express.js is a mistake that needed to be fixed properly for 2.0. The closest behaviour that exists closest to how it should act is currently in another PR. |
Thanks, I was curious, I couldn't find the CHANGELOG. I agree, it's better this way. |
There's a history file here: https://github.com/pillarjs/path-to-regexp/blob/master/History.md. I forgot 1.2 was actually so long ago! |
By bad, I don't have the reflex to look for |
No problem. I believe it's mostly convention from the people who created the projects initially. In every other projects I use releases also 😄 |
endsWith
to match paths like/test?query=string
up to the query stringdelimiters
for specific characters to be treated as parameter prefixes (e.g./:test
)isarray
dependency/test/
is now treated as/test/
instead of/test
when matching)keys
argument that acceptedoptions
keys
list attached to theRegExp
outputtokensToFunction
(e.g.compile
) to accept anencode
function for pretty encoding (e.g. pass your own implementation)