hapijs / joi

The most powerful data validation library for JS
Other
20.95k stars 1.51k forks source link

joi.number.integer accepts 1.0 values (I understand 1.0 is 1 but this should not validate this in joi tester) #2936

Closed Saadzbilal closed 1 year ago

Saadzbilal commented 1 year ago

joi.number.integer accepts 1.0 values (I understand 1.0 is 1 but this should not validate this in joi tester) limit: this.joi.number().integer().min(1).max(60).optional()

image
Marsup commented 1 year ago

This is coherent with the way javascript sees numbers, pretty much the same answer as https://github.com/hapijs/joi/issues/1163.