rawmodel/framework

[feature-request] conditional validations

xpepermint opened this issue · 1 comments

Add option to validate a field only if specific fields are valid.

Validators and handlers now have the condition option which switch off the recipe.

export const fields = {
  email: { 
    validate: [
      {
        ...
        condition () { return true } 
      }
    ],
    handle: [ 
      { 
        ...
        condition () { return true }
      }
    ]
  }
};