Skip to content

Commit

Permalink
Fix code examples in paramTypes docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nene committed Nov 17, 2024
1 parent 201c1a4 commit 8a4a988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/paramTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ You can define a regex pattern to match the custom parameters:

```js
paramTypes: {
custom: [{ regex: '\\{[a-zA-Z0-9_]+\\}' }];
custom: [{ regex: '\\{[a-zA-Z0-9_]+\\}' }],
}
```

Note the double backslashes. You can get around the double-escaping problem by using `String.raw`:

```js
paramTypes: {
custom: [{ regex: String.raw`\{[a-zA-Z0-9_]+\}` }];
custom: [{ regex: String.raw`\{[a-zA-Z0-9_]+\}` }],
}
```

Expand Down

0 comments on commit 8a4a988

Please sign in to comment.