Skip to content

Commit

Permalink
Merge pull request #2875 from dariosn85/bugfix/issue-2874
Browse files Browse the repository at this point in the history
Fix for #2874
  • Loading branch information
Marsup authored Jan 15, 2024
2 parents 3fc290a + 208b6be commit 6814eb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ Adds a custom validation function to execute arbitrary code where:
- `state` - the current validation state.
- `prefs` - the current preferences.
- `original` - the original value passed into validation before any conversions.
- `error(code, [local])` - a method to generate error codes using a message code and optional local context.
- `error(code, [local], [localState])` - a method to generate error codes using a message code, optional local context and optional validation local state.
- `message(messages, [local])` - a method to generate an error with an internal `'custom'` error code and the provided messages object to use as override. Note that this is much slower than using the preferences `messages` option but is much simpler to write when performance is not important.
- `warn(code, [local])` - a method to add a warning using a message code and optional local context.

Expand Down
2 changes: 1 addition & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ declare namespace Joi {
prefs: ValidationOptions;
original: V;
warn: (code: string, local?: Context) => void;
error: (code: string, local?: Context) => ErrorReport;
error: (code: string, local?: Context, localState?: State) => ErrorReport;
message: (messages: LanguageMessages, local?: Context) => ErrorReport;
}

Expand Down

0 comments on commit 6814eb1

Please sign in to comment.