This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of optionals in the middle
Thanks so much for this library! It’s come in very handy in Shields. We’ve significantly reduced the duplication in our route definitions, and we’re getting really close letting developers build badge URLs in the frontend. We’re running into an issue when an optional token precedes the extension. Many of the routes look something like this: `/travis/:user/:repo/:branch?.ext(svg|png)` - That pattern matches `/travis/foo/bar/master.svg` as we’d expect - Unexpectedly it _does not_ match `/travis/foo/bar.svg` - Unexpectedly it _does_ match `/travis/foo/bar/.svg` I traced the behavior back to pillarjs#71 where it was introduced. I _think_ it was unintentional since that PR was about making the leading delimiter optional for an optional token. I don’t see why the delimiter should be present before an optional in the middle. It’s kind of an odd fix, though it makes some sense given pillarjs#71 was about fixing leading optionals.
- Loading branch information