tgriesser / checkit

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

No validation defined for "max:value" and "min:value" #88

Open pmalouin opened 7 years ago

pmalouin commented 7 years ago

With version 0.7.0:

checkit.check('myField', -1 , ['min:0'])
    .catch(console.log.bind(console))

Returns an error with message: 'No validation defined for min'

The min/max validations did not throw in version 0.6.0, but they actually did not work as expected because they used the _.min and _.max methods of lodash that return the smallest/largest value of a collection. This does not seem to be the expected behavior as described in Checkit's documentation.

I think the best course of action would simply be to remove these validators from the documentation as they can already be accomplished with 'greaterThanEqualTo:value' and 'lessThanEqualTo:value'.