tgriesser / checkit

simple, flexible validations for node and the browser
MIT License
223 stars 53 forks source link

"date" validation problem #82

Open pmalouin opened 7 years ago

pmalouin commented 7 years ago

When updating to latest version (0.7.0), I can't get "date" validations to run properly. See:

vagrant@spitdev:/opt/app$ node
> var checkit = require('checkit');
undefined
> var c = new checkit({a:'date'});
undefined
> var body = {a:new Date()};
undefined
> c.run(body).catch(err => console.log(err));
Promise { <pending> }
> { [Error: 1 invalid values]
  message: '1 invalid values',
  errors:
   { a:
      { [Error: No validation defined for date]
        message: 'No validation defined for date',
        errors: [Object],
        key: 'a' } } }

I presume the problem is caused by commit 3307c84aed50a560260c16ea307300452dae9b20, which did not bring in the isDate method?

cliedelt commented 7 years ago

The version 0.7 is broken use 0.6 install with: npm install checkit@0.6