When generating an example value for Joi.number().min().max() in which the min and max values are equal, return the only valid value, which is min.
Related Issue
91
Motivation and Context
When Joi.number() had equal values provided/defaulted for .min() and .max(), the Felicity.example method would hang in an infinite loop expecting min < value && value < max.
This patch prevents that loop.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue. you didn't modify existing tests)
Description
When generating an example value for
Joi.number().min().max()
in which the min and max values are equal, return the only valid value, which ismin
.Related Issue
91
Motivation and Context
When
Joi.number()
had equal values provided/defaulted for.min()
and.max()
, theFelicity.example
method would hang in an infinite loop expectingmin < value && value < max
. This patch prevents that loop.Types of changes
Checklist: