Skip to content

Conversation

@micha149
Copy link

@micha149 micha149 commented Feb 5, 2015

I updated path-to-regexp to the latest version. Because this will break slightly backwards compatibility, I would suggest to do this update for the upcoming major release. Major changes are the following:

  • Regular expressions have to be wrapped by parentheses e.g. /users/(\\d+)
  • Standalone asterisk must be written as expression e.g. /(.*)
  • Match one or more parameters e.g /templates/:template+
  • Match zero or more parameters /files/:path*
  • Optional parameters :foo/:bar?
Because of api changes, some tests had be updated. Backwards incampatible changes are: - Regular expressions have to be wrapped by parentheses -> /users/(\\d+) - standalone asterisk must be written as expression -> /(.*) Benefits: - Match one or more parameters -> /templates/:template+ - Match zero or more parameters -> /files/:path* - Optional parameters -> :foo/:bar?
The test description did not match the contained expectation.
@blakeembrey
Copy link
Member

Just FYI, the latest version is currently 1.2.0 and (again) supports the asterisk 😄

@micha149
Copy link
Author

Oh, totally forgotten this PR… :rage4:

@davebaol
Copy link

davebaol commented May 6, 2016

Unfortunately path-to-regexp 0.1.7 is kinda buggy when using empty params. Latest version works good though.
Any chance to get this PR merged within a reasonable amount of time?
BTW, the latest version is currently 1.2.1

@blakeembrey
Copy link
Member

@davebaol It can't be merged until 5.0 of Express.js.

@wesleytodd
Copy link
Member

Closing this because it has been superseded by pillarjs/router#42

@wesleytodd wesleytodd closed this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants