Skip to content

Commit

Permalink
Merge pull request hapijs#2923 from hapijs/chore/docs
Browse files Browse the repository at this point in the history
chore: fix wrong usage of Joi.expression
  • Loading branch information
Marsup authored Mar 2, 2023
2 parents ff3e5fc + b0d8df8 commit 227e761
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ Using a regular expression with template:

```js
const schema = Joi.object()
.rename(/^(\d+)$/, Joi.template('x{#1}x'))
.rename(/^(\d+)$/, Joi.expression('x{#1}x'))
.pattern(/^x\d+x$/, Joi.any());

const input = {
Expand Down

0 comments on commit 227e761

Please sign in to comment.