Repository navigation
Releases
Releases · pillarjs/path-to-regexp
v9.0.0
Immutable
release. Only release title and notes can be modified.
Important: This release switches the package to ESM only and node >= 22. The primary incompatible API change is to switch ambiguous matches (2+ parameters in a segment) from the first being greedy to the last. For example:
const input = "/foo.json.html";
const fn = match("/:file.:ext");
fn(input); //=> ["foo", "json.html"]In the v8 this would have output ["foo.json", "html"]. Making the last parameter and wildcard greedy can improve performance of the regular expressions and makes it easier to build non-regex based versions of the matcher.
Changed
- Avoid duplicate trailing delimiter matches by @vibhor-aggr in #443
- A path that explicitly provided the trailing delimiter (e.g.
/foo/) will no longer append an extra optional delimiter
- A path that explicitly provided the trailing delimiter (e.g.
- Refactor matching to be non-greedy by @blakeembrey in #450
- Build project as ESM by @blakeembrey in #458
- Remove
TokenDataclass andKeystype by @blakeembrey in #461
Fixed
- Reject an empty-string param in compile by @spokodev in #444
- Reject wildcard array that compiles to an empty path by @spokodev in #448
- Fix stringify of param names with control characters by @chatman-media in #445
- Quote param names followed by astral ID_Continue text by @dylanpulver in #451
- Fix stringify lookahead across empty text tokens by @jakezwang in #456
Full Changelog: v8.4.2...v9.0.0
v8.4.2
Immutable
release. Only release title and notes can be modified.
v8.4.1
Immutable
release. Only release title and notes can be modified.
Fixed
- Remove trie deduplication (#431) 6bc8e84
- Using a trie required non-greedy matching, which regressed wildcards in non-ending mode by matching them up until the first match. For example:
/*foowith/a/b=/a/*foo.htmlwith/a/b.html/c.html=/a/b.html
- Using a trie required non-greedy matching, which regressed wildcards in non-ending mode by matching them up until the first match. For example:
- Allow backtrack handling to match itself (#427) 5bcd30b
- When backtracking was introduced, it rejected matching things like
/:"a"_:"b"against/foo__. This makes intuitive sense because the second parameter is not going to backtrack on_anymore, but it's somewhat unexpected since there's no reason it shouldn't match the second_.
- When backtracking was introduced, it rejected matching things like
v8.4.0
Immutable
release. Only release title and notes can be modified.
Important
Fixed
- Restricts wildcard backtracking when using more than 1 in a path (#421)
Changed
- Dedupes regex prefixes (#422)
- This will result in shorter regular expressions for some cases using optional groups
- Rejects large optional route combinations (#424)
- When using groups such as
/users{/delete}it will restrict the number of generated combinations to < 256, equivalent to 8 top-level optional groups and unlikely to occur in a real world application, but avoids exploding the regex size for applications that accept user created routes
- When using groups such as
0.1.13
Immutable
release. Only release title and notes can be modified.
v8.3.0
Fix backtracking (again)
Fixed
- Improved backtracking protection for 0.1.x, will break some previously valid paths (see previous advisory: GHSA-9wv6-86v2-598j)
v8.2.0
Immutable
release. Only release title and notes can be modified.
Fixed
- Allowing
path-to-regexpto run on older browsers by targeting ES2015