Skip to content
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

Update path-to-regexp to 1.0.3 #2530

Closed
wants to merge 3 commits into from
Closed

Update path-to-regexp to 1.0.3 #2530

wants to merge 3 commits into from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants