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
Copy file name to clipboardExpand all lines: Readme.md
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -242,25 +242,26 @@ A `parse` function is available and returns `TokenData`, the set of tokens and o
242
242
243
243
### Token Information
244
244
245
-
-`name` The name of the token (`string` for named or `number` for unnamed index)
246
-
-`prefix` The prefix string for the segment (e.g. `"/"`)
247
-
-`suffix` The suffix string for the segment (e.g. `""`)
248
-
-`pattern` The RegExp used to match this token (`string`)
249
-
-`modifier` The modifier character used for the segment (e.g. `?`)
250
-
-`separator`_(optional)_ The string used to separate repeated parameters (modifier is `+` or `*`)
251
-
-`optional`_(optional)_ A boolean used to indicate whether the parameter is optional (modifier is `?` or `*`)
245
+
-`name` The name of the token
246
+
-`prefix`_(optional)_ The prefix string for the segment (e.g. `"/"`)
247
+
-`suffix`_(optional)_ The suffix string for the segment (e.g. `""`)
248
+
-`pattern`_(optional)_ The pattern defined to match this token
249
+
-`modifier`_(optional)_ The modifier character used for the segment (e.g. `?`)
250
+
-`separator`_(optional)_ The string used to separate repeated parameters
252
251
253
252
## Errors
254
253
255
254
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.
256
255
257
256
### Unexpected `?`, `*`, or `+`
258
257
259
-
In previous major versions,`/`or`.` were used as implicit prefixes of parameters. So `/:key?` was implicitly `{/:key}?`.
258
+
In previous major versions `/`and`.` were used as implicit prefixes of parameters. So `/:key?` was implicitly `{/:key}?`. For example:
260
259
261
-
This has been made explicit. Assuming `?` as the modifier, if you have a `/` or `.` before the parameter, you want `{.:ext}?` or `{/:ext}?`. If not, you want `{:ext}?`.
260
+
-`/:key?` → `{/:key}?` or `/:key*` → `{/:key}*` or `/:key+` → `{/:key}+`
261
+
-`.:key?` → `{.:key}?` or `.:key*` → `{.:key}*` or `.:key+` → `{.:key}+`
262
+
-`:key?` → `{:key}?` or `:key*` → `{:key}*` or `:key+` → `{:key}+`
262
263
263
-
### Unexpected `!`, `@`, or `;`
264
+
### Unexpected `!`, `@`, `,`, or `;`
264
265
265
266
These characters have been reserved for future use.
0 commit comments