We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 010d1e2 commit 0f78bf1Copy full SHA for 0f78bf1
lib/schema/int32.js
@@ -89,10 +89,7 @@ SchemaInt32._defaultCaster = v => {
89
const INT32_MIN = -0x80000000;
90
91
if (v != null) {
92
- if (typeof v !== 'number') {
93
- throw new Error();
94
- }
95
- if (v < INT32_MIN || v > INT32_MAX) {
+ if (typeof v !== 'number' || v !== (v | 0) || v < INT32_MIN || v > INT32_MAX) {
96
throw new Error();
97
}
98
0 commit comments