How to use the @aurelia/validation.LengthRule function in @aurelia/validation

To help you get started, we’ve selected a few @aurelia/validation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / __tests__ / validation / rule.spec.ts View on Github external
it(`LengthRule#execute validates ${value} to be ${isValid} for length constraint ${length}`, function () {
      const sut = new LengthRule((void 0)!, length, isMax);
      assert.equal(sut.messageKey, isMax ? 'maxLength' : 'minLength');
      assert.equal(sut.execute(value), isValid);
    })
  );
github aurelia / aurelia / packages / __tests__ / validation / rule.spec.ts View on Github external
      getRule: (sut: IValidationMessageProvider) => new LengthRule(sut, 42, true),
    },
github aurelia / aurelia / packages / __tests__ / validation / rule.spec.ts View on Github external
      getRule: (sut: IValidationMessageProvider) => new LengthRule(sut, 42, false),
    },