integer
Accepts only finite whole numbers.Validation Rules
- Must be a finite number (rejects
NaNandInfinity) - Must be a whole number (no decimal places)
- Accepts negative integers, zero, and positive integers
Examples
Use Cases
- Array indices
- Count values
- ID fields that must be whole numbers
- Age or year values
positiveInteger
Accepts only non-negative (zero or positive) finite whole numbers.Validation Rules
- Must be a finite number
- Must be a whole number
- Must be greater than or equal to 0
- Rejects
-0(negative zero)
Examples
Use Cases
- Array lengths
- Counts and quantities
- Pagination page numbers
- Non-negative ID values
bigint
Accepts any validbigint value.
Validation Rules
- Must be a JavaScript
biginttype - Accepts any valid bigint value (no range restrictions)
Examples
Use Cases
- Large integer values beyond
Number.MAX_SAFE_INTEGER - Cryptographic operations
- High-precision integer calculations
- Blockchain and cryptocurrency amounts
