Closed
Description
Context
- joi version: 15.1.1 & HEAD
What are you trying to achieve or the steps to reproduce ?
const schema = Joi.number();
schema.validate('1e3'); // => { value: 1000 }
schema.validate(1E3); // => { value: 1000 }
schema.validate('1E3'); // fails
Which result you had ?
{
value: 1000,
error: [Error [ValidationError]: "value" must be a safe number] {
_original: '1E3',
details: [ [Object] ]
}
}
What did you expect ?
{ value: 1000 }