-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codefeatureNew functionality or improvementNew functionality or improvement
Milestone
Description
Context
- node version: v8.6.0
- joi version: 10.6.0
- environment (node, browser): Node JS
- any other relevant information:
const schema = Joi.object().keys({ id: Joi.number() })
let id = 10107199254749992
console.log(id > Number.MAX_SAFE_INTEGER) // logs 'true'
parseInt(110107199254749992) == 110107199254749980 // = true, because the value is too highwhen using an integer value > Number.MAX_SAFE_INTEGER, Joi simply parsed the value without warning.
This resulted in values being valid, when they're not
I think there should be a verification with Number.isSafeInteger(value) before parsing a number
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codefeatureNew functionality or improvementNew functionality or improvement