Skip to content

Commit

Permalink
updates the Validators.Base.CheckerFunction typing to be more strict,…
Browse files Browse the repository at this point in the history
… this potentially saves some debuggin hours when implementing a custom validator
  • Loading branch information
fugufish committed Sep 20, 2024
1 parent 525c582 commit 30644b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/validators/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ declare namespace BaseValidator {
paramName?: string;
}

export type CheckerFunction = Function & { async: boolean };
type CheckerFunctionBase = (params: Record<string, unknown>, opts?: { meta: { ctx: Context } }) => boolean | Promise<boolean>
export type CheckerFunction = CheckerFunctionBase & { async?: boolean };
}

declare abstract class BaseValidator {
Expand Down

0 comments on commit 30644b9

Please sign in to comment.