aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

several rules unnecessarily insert 'true' if no other argument #118

Closed gravsten closed 8 years ago

gravsten commented 8 years ago

These rules are: date, datetime, email, numericality, presence, url.

For example:

ValidationRule.presence = function presence() {
      var config = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];

      return new ValidationRule('presence', config);
    };

This doesn't seem to be based on any special handling in these rules, and thus may probably be changed to:

ValidationRule.presence = function presence(config) {
      return new ValidationRule('presence', config);
    };

As a result, '@require' would result in config being undefined... without any side effect.

jdanyow commented 8 years ago

closing- validatejs was dropped in last release