xogroup / felicity

Javascript object constructors and sample data based on Joi schema.
Other
111 stars 9 forks source link

Fix infite loop on number example #93

Closed WesTyler closed 7 years ago

WesTyler commented 7 years ago

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

Checklist: