We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
t.Int uses Number.isInteger which is unsafe to use outside of range <Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER> (non-integer inputs will return false positive). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
To be safe t.Int could fail validation of Numbers outside of range <Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER>
Use Number.isSafeInteger instead of Number.isInteger
Number.isSafeInteger
Number.isInteger
Everyone using t.Int
Provide a secondary type t.SafeInt?
Thanks for a great library, this is something that perhaps could make using it safer :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🚀 Feature request
Current Behavior
t.Int uses Number.isInteger which is unsafe to use outside of range <Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER> (non-integer inputs will return false positive). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
Desired Behavior
To be safe t.Int could fail validation of Numbers outside of range <Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER>
Suggested Solution
Use
Number.isSafeInteger
instead ofNumber.isInteger
Who does this impact? Who is this for?
Everyone using t.Int
Describe alternatives you've considered
Provide a secondary type t.SafeInt?
Additional context
Thanks for a great library, this is something that perhaps could make using it safer :)
Your environment
The text was updated successfully, but these errors were encountered: