poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

"Range" should be inclusive #171

Closed danilopolani closed 6 years ago

danilopolani commented 6 years ago

If I use the range rule with 1,5, if the data is "1" it should work, at this time it fails. At least I think so, maybe I'm wrong, but in laravel it works like this (inclusive).

RomainLanz commented 6 years ago

I agree with that. Range should be inclusive.

I believe this should be considered as a breaking change. What do you think @thetutlage ?

thetutlage commented 6 years ago

I believe the best way is to create a new rule rangeInclusive. I know it feels weird, but for meanwhile, we can use it as a fallback, since I don't want to introduce breaking changes

thetutlage commented 6 years ago

Closing, since there is no activity. Will look into adding inside a breaking change