Overview
Primitive validators ensure that a value is one of JavaScript’s built‑in primitive types and meets specific criteria. They return simple booleans, never throw, and never mutate input.
- validateBigInteger: Validates whether a value is a
bigintprimitive. - validateBoolean: Validates whether a value is a boolean.
- validateFiniteNumber: Validates whether a value is a finite number.
- validateInteger: Validates whether a value is an integer.
- validateNegativeInteger: Validates whether a value is a negative integer.
- validateNegativeNumber: Validates whether a value is a negative number.
- validateNonEmptyString: Validates whether a value is a non‑empty string.
- validateNonNegativeInteger: Validates whether a value is a non‑negative integer (zero or positive).
- validateNonNegativeNumber: Validates whether a value is a non‑negative number (zero or positive).
- validateNull: Validates whether a value is
null. - validateNumber: Validates whether a value is a number.
- validateNumberRange: Validates whether a value is a number within a specified inclusive range.
- validatePositiveInteger: Validates whether a value is a positive integer.
- validatePositiveNumber: Validates whether a value is a positive number.
- validateSafeInteger: Validates whether a value is a safe integer (between
$-(2^{53} - 1)$and$2^{53} - 1$). - validateString: Validates whether a value is a string.
- validateStringLength: Validates whether a value is a string whose length falls within a specified inclusive range.
- validateSymbol: Validates whether a value is a symbol.
- validateUndefined: Validates whether a value is
undefined.
All primitive validators are pure, predictable, and safe to use before complex data processing or transformation.