Skip to main content

Function: isValidInteger()

isValidInteger(value: unknown, options?: IsIntOptions): value is string

Defined in: shared/validation/validatorUtils.ts:154

Validates that a value is a valid integer within optional bounds.

Parametersโ€‹

valueโ€‹

unknown

Value to validate

options?โ€‹

IsIntOptions

Integer validation options

Returnsโ€‹

value is string

True if value is a valid integer

Exampleโ€‹

isValidInteger("123"); // true
isValidInteger("123.45"); // false
isValidInteger("123", { min: 100, max: 200 }); // true