fix: use integer check which doesn't require value to be 32 bit

This commit is contained in:
Tom French 2022-07-27 20:19:11 +01:00 committed by James Long
parent 12289792da
commit 423f355766

View file

@ -42,7 +42,7 @@ export function convertInputType(value, type) {
} }
return value; return value;
case 'integer': case 'integer':
if (typeof value === 'number' && (value | 0) === value) { if (typeof value === 'number' && Number.isInteger(value)) {
return value; return value;
} else { } else {
throw new Error("Can't convert to integer: " + JSON.stringify(value)); throw new Error("Can't convert to integer: " + JSON.stringify(value));