Returns true if error messages may include a diff that compares actual and expected values.
true by default
Specifies that error messages may include a diff that compares actual and expected values.
true by default
this
OptionalmayDiff: booleanReturns a function that transforms the validation error before it is thrown or returned. If the function
returns undefined or null, it’s treated as if it returned the input error.
a function that transforms the validation error
Sets a function that transforms the validation error before it is thrown or returned. If the function
returns undefined or null, it’s treated as if it returned the input error.
this
Returns true if error stack traces should reference the code that triggers a validation
failure. When set to false, the error type remains unchanged, but the stack trace location is
undefined. Users who only plan to list of failure messages
instead of errors may experience a performance improvement if this value is set to false.
true if errors must be recorded when a validation failure occurs
Specifies whether error stack traces should reference the code that triggers a validation failure.
When set to false, the error type remains unchanged, but the stack trace location is
undefined. Users who only plan to list of failure messages
instead of errors may experience a performance improvement if this value is set to false.
true if errors must be recorded when a validation failure occurs
this
OptionalrecordStacktrace: booleanReturns the configuration used to map contextual values to a String. Supports common types such as arrays or numbers.
a function that takes an object and returns the string representation of the object
Updates the configuration used by new validators.