UNPKG

@vitruvius-labs/ts-predicate

Version:
9 lines (8 loc) 285 B
import { isInteger } from "../type-guard/is-integer.mjs"; import { ValidationError } from "./utils/validation-error.mjs"; function assertInteger(value) { if (!isInteger(value)) { throw new ValidationError("The value must be an integer."); } } export { assertInteger };