Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #431 +/- ##
==========================================
- Coverage 99.75% 99.74% -0.02%
==========================================
Files 1 1
Lines 416 389 -27
Branches 157 148 -9
==========================================
- Hits 415 388 -27
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| { | ||
| input: "/foo/bar.html/baz.html", | ||
| expected: { | ||
| path: "/foo/bar.html/baz.html", |
There was a problem hiding this comment.
This is may be the clearest example of the issue and why it's impossible with the trie. The wildcard is expected to go over the first .:ext and use the last one, but with it being lazy it'd grab the first only.
And we can't just make it greedy with the trie because it breaks /*path{.:ext} where .:ext is optional, because then the greedy one just gobbles up everything and leaves .:ext always unmatched.
Unfortunately the trie was added to improve regex performance a little bit by deduplicating prefixes, so that optimization isn't possible without breaking this wildcard pattern in use.
Closes #430. The trie required a non-greedy match to work, and that results in an edge case with wildcards at the end of a path in
end: falsemode because it'd match up to the first match instead of all the way to the end. I hadn't anticipated the wildcard usage +end: false, then using the resulting path instead oforiginalPathin Express, in my refactoring.