validators/cached library
Cached Validators
This file contains cached instances of zero-argument validators for performance
and readability. Instead of calling isString() repeatedly, you can use the
constant $isString.
These cached validators are pre-instantiated for better performance and provide the same functionality as their function counterparts.
Properties
- $isBool → IValidator
-
Cached instance of isBool.
Validates that the value is a bool.
final
- $isBoolString → IValidator
-
Cached instance of isBoolString.
Validates that the string can be parsed as a boolean.
final
- $isDate → IValidator
-
Cached instance of isDate.
Validates that the string is a valid DateTime format.
final
- $isDateTime → IValidator
-
Cached instance of isDateTime.
Validates that the value is a DateTime.
final
- $isDouble → IValidator
-
Cached instance of isDouble.
Validates that the value is a double.
final
- $isDoubleString → IValidator
-
Cached instance of isDoubleString.
Validates that the string can be parsed as a double.
final
- $isEmail → IValidator
-
Cached instance of isEmail.
Validates that the string is a valid email address.
final
- $isEnum → IValidator
-
Cached instance of isEnum.
Validates that the value is an enum value.
final
- $isFunction → IValidator
-
Cached instance of isFunction.
Validates that the value is a Function.
final
- $isFuture → IValidator
-
Cached instance of isFuture.
Validates that the value is a Future.
final
- $isInt → IValidator
-
Cached instance of isInt.
Validates that the value is an int.
final
- $isIntString → IValidator
-
Cached instance of isIntString.
Validates that the string can be parsed as an integer.
final
- $isIterable → IValidator
-
Cached instance of isIterable.
Validates that the value is an Iterable.
final
- $isList → IValidator
-
Cached instance of isList.
Validates that the value is a List.
final
- $isLowerCase → IValidator
-
Cached instance of isLowerCase.
Validates that the string contains only lowercase characters.
final
- $isMap → IValidator
-
Cached instance of isMap.
Validates that the value is a Map.
final
- $isNonEmptyList → IValidator
-
Cached instance for a present (non-null AND non-empty) list.
Equivalent to:
all([$isList, $listNotEmpty]).final - $isNonEmptyString → IValidator
-
Cached instance representing a non-empty String.
Equivalent to:
all([$isString, not($isStringEmpty)]). Valid when the value is a String and not empty.final - $isNotNull → IValidator
-
Cached instance representing NOT null (i.e. value must be non-null).
Equivalent to:
not($isNull).final - $isNull → IValidator
-
Cached instance of isNull.
Validates that the value is null.
final
- $isNumber → IValidator
-
Cached instance of isNumber.
Validates that the value is a num (int or double).
final
- $isNumString → IValidator
-
Cached instance of isNumString.
Validates that the string can be parsed as a number.
final
- $isRecord → IValidator
-
Cached instance of isRecord.
Validates that the value is a Record.
final
- $isSet → IValidator
-
Cached instance of isSet.
Validates that the value is a Set.
final
- $isStrictUrl → IValidator
-
Cached instance of isStrictUrl.
Validates that the string is a valid URL with strict requirements.
final
- $isString → IValidator
-
Cached instance of isString.
Validates that the value is a String.
final
- $isStringEmpty → IValidator
-
Cached instance of isStringEmpty.
Validates that the value is empty (string, list, map, etc.).
final
- $isSymbol → IValidator
-
Cached instance of isSymbol.
Validates that the value is a Symbol.
final
- $isUpperCase → IValidator
-
Cached instance of isUpperCase.
Validates that the string contains only uppercase characters.
final
- $isUrl → IValidator
-
Cached instance of isUrl.
Validates that the string is a valid URL.
final
- $isUuidV4 → IValidator
-
Cached instance of isUuidV4.
Validates that the string is a valid UUID v4.
final
- $listEmpty → IValidator
-
Cached instance of listEmpty.
Validates that the list is empty.
final
- $listNotEmpty → IValidator
-
Cached instance of not applied to $listEmpty.
Validates that the list is not empty.
final
- $optionalNonEmptyList → IValidator
-
Cached instance for a nullable non-empty list (null passes, empty list fails).
final
- $optionalNonEmptyString → IValidator
-
Cached instance for optional (nullable) non-empty string: accepts null OR a non-empty string.
Usage:
$optionalNonEmptyString.validate(null)-> valid;.validate('')-> invalid.final