Skip to content

Commit

Permalink
Merge pull request #2983 from hapijs/fix/error-return-type
Browse files Browse the repository at this point in the history
fix: allow any.error() return type to be ErrorReport[]
  • Loading branch information
Marsup committed Aug 31, 2023
2 parents b655785 + 0cce812 commit 9ead10b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.d.ts
Expand Up @@ -693,7 +693,7 @@ declare namespace Joi {
context?: Context;
}

type ValidationErrorFunction = (errors: ErrorReport[]) => string | ValidationErrorItem | Error;
type ValidationErrorFunction = (errors: ErrorReport[]) => string | ValidationErrorItem | Error | ErrorReport[];

interface ValidationWarning {
message: string;
Expand Down

0 comments on commit 9ead10b

Please sign in to comment.