markusbohl / fluent-ts-validator

Fluent Validation in TypeScript
30 stars 8 forks source link

Is asynchronous custom validation supported? #14

Open ReinisV opened 4 years ago

ReinisV commented 4 years ago
this.validateIf(customerAccount => customerAccount.userName)
  .fulfills(async (userName) => {
    // todo add request to api
    return false;
  })
 .withFailureMessage("username already taken");

fails to compile with type error Type 'Promise<boolean>' is not assignable to type 'boolean'. and I'm not seeing any other ways in the documentation to implement this functionality.

is there any support asynchronous custom validation?