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
A `parse` function is available and returns `TokenData`, the set of tokens and other metadata parsed from the input string. `TokenData` is can passed directly into `pathToRegexp`, `match`, and `compile`. It accepts only two options, `delimiter` and `encodePath`, which makes those options redundant in the above methods.
242
256
243
-
### Token Information
257
+
### Tokens
258
+
259
+
The `tokens` returned by `TokenData` is an array of strings or keys, represented as objects, with the following properties:
244
260
245
261
-`name` The name of the token
246
262
-`prefix`_(optional)_ The prefix string for the segment (e.g. `"/"`)
@@ -249,6 +265,20 @@ A `parse` function is available and returns `TokenData`, the set of tokens and o
249
265
-`modifier`_(optional)_ The modifier character used for the segment (e.g. `?`)
250
266
-`separator`_(optional)_ The string used to separate repeated parameters
251
267
268
+
### Custom path
269
+
270
+
In some applications, you may not be able to use the `path-to-regexp` syntax (e.g. file-based routing), but you can still use this library for `match`, `compile`, and `pathToRegexp` by building your own `TokenData` instance. For example:
An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before.
0 commit comments