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
-**decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`)
66
+
67
+
```js
68
+
constfn=match("/foo/:bar");
69
+
```
70
+
71
+
**Please note:**`path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
72
+
73
+
## PathToRegexp
74
+
75
+
The `pathToRegexp` function returns a regular expression for matching strings against paths. It
76
+
67
77
-**path** String or array of strings.
68
78
-**options**_(optional)_ (See [parse](#parse) for more options)
69
79
-**sensitive** Regexp will be case sensitive. (default: `false`)
70
80
-**end** Validate the match reaches the end of the string. (default: `true`)
71
81
-**delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`)
72
82
-**trailing** Allows optional trailing delimiter to match. (default: `true`)
73
-
-**decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`)
74
83
75
84
```js
76
-
constfn=match("/foo/:bar");
85
+
const{ regexp, keys } =pathToRegexp("/foo/:bar");
77
86
```
78
87
79
-
**Please note:**`path-to-regexp` is intended for ordered data (e.g. pathnames, hostnames). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
80
-
81
88
## Compile ("Reverse" Path-To-RegExp)
82
89
83
90
The `compile` function will return a function for transforming parameters into a valid path:
0 commit comments