Skip to content

1.0.0-beta.1.0.0

Compare
Choose a tag to compare
@EisenbergEffect EisenbergEffect released this 09 Dec 03:52
· 160 commits to master since this release

breaking changes

  1. ValidationError class renamed ValidateResult. Previously ValidationError represented a broken rule. Now ValidateResult represents the result of evaluating a rule and the pass/fail status is stored in a new boolean property named valid.
  2. RenderInstruction, which is the argument passed to validation renderers, now recieves ValidateResults instead of ValidationErrors. This means you'll need to skip rendering results whose valid property is true OR you'll need to add logic to render "success". Examples of both are in the docs.
  3. The ValidationController's validate method has a new return type. Previously it was Promise<ValidationError[]>. Now it's Promise<ControllerValidateResult>. This means you'll need to change code like this:
    js controller.validate().then(errors => { if (errors.length === 0) { // valid :) } else { // invalid :( } });
    To something like this:
    js controller.validate().then(result => { if (result.valid) { // valid :) } else { // invalid :( } });