diff --git a/src/types/integer.ts b/src/types/integer.ts index 5eaea23e..97b74d5e 100644 --- a/src/types/integer.ts +++ b/src/types/integer.ts @@ -29,11 +29,11 @@ class SchemaTypeInteger extends SchemaTypeNumber { validate(value_?, data?): number { const value = super.validate(value_, data); - if (value % 1 !== 0) { + if (!Number.isInteger(value)) { throw new ValidationError(`\`${value}\` is not an integer!`); } - return value; + return value as number; } }