Skip to content

Commit 6814eb1

Browse files
authored
Merge pull request hapijs#2875 from dariosn85/bugfix/issue-2874
Fix for hapijs#2874
2 parents 3fc290a + 208b6be commit 6814eb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ Adds a custom validation function to execute arbitrary code where:
614614
- `state` - the current validation state.
615615
- `prefs` - the current preferences.
616616
- `original` - the original value passed into validation before any conversions.
617-
- `error(code, [local])` - a method to generate error codes using a message code and optional local context.
617+
- `error(code, [local], [localState])` - a method to generate error codes using a message code, optional local context and optional validation local state.
618618
- `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.
619619
- `warn(code, [local])` - a method to add a warning using a message code and optional local context.
620620

lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ declare namespace Joi {
749749
prefs: ValidationOptions;
750750
original: V;
751751
warn: (code: string, local?: Context) => void;
752-
error: (code: string, local?: Context) => ErrorReport;
752+
error: (code: string, local?: Context, localState?: State) => ErrorReport;
753753
message: (messages: LanguageMessages, local?: Context) => ErrorReport;
754754
}
755755

0 commit comments

Comments
 (0)