Skip to content

Commit

Permalink
Remove loose string reference
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jun 20, 2024
1 parent 17ce0be commit c0736d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ regexp.exec("/bar/baz");

#### Wildcard

A wildcard can also be used. It is roughly equivalent to `(.*)` except when decoding in `match` below it splits on the delimiter.
A wildcard can also be used. It is roughly equivalent to `(.*)`.

```js
const regexp = pathToRegexp("/*");
// keys = [{ name: '0', pattern: '[^\\/]*', modifier: '*' }]
// keys = [{ name: '0', pattern: '[^\\/]*', separator: '/', modifier: '*' }]

regexp.exec("/");
//=> [ '/', '', index: 0 ]
Expand Down Expand Up @@ -234,7 +234,7 @@ toPathRegexp({ id: "123" }); //=> "/user/123"

- If you are rewriting paths with match and compiler, consider using `encode: false` and `decode: false` to keep raw paths passed around.
- To ensure matches work on paths containing characters usually encoded, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`.
- If matches are intended to be exact, you need to set `loose: ''`, `trailing: false`, and `sensitive: true`.
- If matches are intended to be exact, you need to set `loose: false`, `trailing: false`, and `sensitive: true`.

### Parse

Expand Down

0 comments on commit c0736d4

Please sign in to comment.