You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`matchPattern` uses token-based comparision to completely forego regular expressions, which should, technically, make it more performant and less prone to vulnerabilities. Doesn't promise full feature parity with `path-to-regexp` but currently uses its test suite as the compliance bar.
48
45
49
-
- URL strings and `URL` instances as the `input`;
50
-
- Absolute and relative URLs;
51
-
- Wildcards (`http://*.domain.com:*/route`);
52
-
- Path parameters, including optional (`:param?`), splat (`:param*`), and one-or-more (`:param+`) modifiers;
53
-
- Encoded URL segments;
46
+
#### Absolute and relative URLs
54
47
55
-
`matchPattern` uses token-based comparision to completely forego regular expressions, which should, technically, make it more performant and less prone to vulnerabilities. Doesn't promise full feature parity with `path-to-regexp` but currently uses its test suite as the compliance bar.
The pattern is the source of truth. If it ends with a trailing slash, then the input must also end with it to match. If the pattern doesn't end with a trailing slash, then the trailing slash in the input is ignored when matching.
> If no value is present at the wildcard's position, the pattern will still match with the wildcard parameter value `''`. Wildcards are, effectively, unnamed splat parameters.
122
+
123
+
A slash preceding a wildcard is not a part of the wildcard and is _required_:
0 commit comments