checkit icon indicating copy to clipboard operation
checkit copied to clipboard

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

Open pmalouin opened this issue 8 years ago • 0 comments

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'.

pmalouin avatar Feb 03 '17 14:02 pmalouin