Seed
Optional
options: ContainsOptionsPrivate
entityEntity to get the value of the attribute
Check if the string matches the comparison.
String to compare
Private
errorsThe cached errors of the validation
Check if the string is a date that's after the specified date.
Optional
date: stringDate string (defaults to now)
Check if the string contains only letters (a-zA-Z).
Optional
locale: AlphaLocaleAlphaLocale
Optional
options: IsAlphaOptionsIsAlphaOptions
Check if the string contains only letters and numbers.
Optional
locale: AlphanumericLocaleAlphanumericLocale
Optional
options: IsAlphanumericOptionsIsAlphanumericOptions
Check if the string contains ASCII chars only.
Check if a string is a BIC (Bank Identification Code) or SWIFT code.
Check if a string is base32 encoded.
check if a string is base58 encoded
Check if a string is base64 encoded.
Optional
options: IsBase64OptionsOptions
Check if the string is a date that's before the specified date.
Optional
date: stringDate string (defaults to now)
check if a string is a boolean.
Optional
options: OptionsCheck if the string is a valid BTC address.
Check if the string's length (in UTF-8 bytes) falls in a range.
Optional
options: IsByteLengthOptionsOptions
Check if the string is a credit card.
Optional
options: IsCreditCardOptionsCheck if the string is a valid currency amount.
Optional
options: IsCurrencyOptionsOptions
Check if the string is a data uri format.
Check if the string is a valid date.
Optional
options: IsDateOptionsCheck if the string represents a decimal number,
such as 0.1
, .3
, 1.1
, 1.00003
, 4.0
etc.
Optional
options: IsDecimalOptionsOptions
Check if the string is a number that's divisible by another.
Divider number
Check if the string is an EAN (European Article Number).
Check if the string is an email.
Optional
options: IsEmailOptionsOptions
Check if the string has a length of zero.
Optional
options: IsEmptyOptionsOptions
Check if the string is an Ethereum address using basic regex. Does not validate address checksums.
Check if the string is a fully qualified domain name (e.g. domain.com
).
Optional
options: IsFQDNOptionsOptions
Check if the string is a float.
Optional
options: IsFloatOptionsOptions
Check if the string contains any full-width chars.
Check if the string is an HSL (hue, saturation, lightness, optional alpha) color based on CSS Colors Level 4 specification. Comma-separated format supported. Space-separated format supported with the exception of a few edge cases (ex: hsl(200grad+.1%62%/1)).
Check if the string contains any half-width chars.
Check if the string is a hash of type algorithm.
HashAlgorithm
Check if the string is a hexadecimal color.
Check if the string is a hexadecimal number.
Check if a string is a IBAN (International Bank Account Number).
Check if the string is a valid IMEI.
Non-hyphenated (###############
) only is supported by default.
Use the options
param to enable hyphenated (##-######-######-#
) support.
Optional
options: IsIMEIOptionsOptions
Check if the string is an IP (version 4 or 6).
Optional
version: IPVersionIP Version
Check if the string is an IP Range (version 4 or 6).
Optional
version: IPVersionCheck if the string is an ISBN (version 10 or 13).
Optional
version: ISBNVersionISBN Version
Check if the string is an ISIN (stock/security identifier).
Check if the string is a valid ISO 3166-1 alpha-2 officially assigned country code.
Check if the string is a valid ISO 3166-1 alpha-3 officially assigned country code.
Check if the string is a valid ISO 4217 officially assigned currency code.
Check if the string is a valid ISO 8601 date.
Optional
options: IsISO8601OptionsOptions
Check if the string is a ISRC.
Check if the string is an ISSN.
Optional
options: IsISSNOptionsOptions
Check if the string is a valid identity card code.
Optional
locale: "any" | IdentityCardLocaleIdentityCardLocale
Check if the string is in a array of allowed values.
Allowed values.
Check if the string is an integer.
Optional
options: IsIntOptionsOptions
Check if the string is valid JSON (note: uses JSON.parse
).
Check if the string is valid JWT token.
Check if the string is a valid latitude-longitude coordinate in the format:
lat,long
or lat, long
.
Check if the string's length falls in a range.
Note: this function takes into account surrogate pairs.
Optional
options: IsLengthOptionsOptions
Check if the string is a locale.
Check if the string is lowercase.
Check if the string is a MAC address.
Optional
options: IsMACAddressOptionsOptions
Check if the string is a MD5 hash.
Check if the string is a magnet uri format.
Check if the string matches to a valid MIME type format.
Check if the string is a mobile phone number.
Optional
locale: "any" | MobilePhoneLocale | MobilePhoneLocale[]MobilePhoneLocale(s)
Optional
options: IsMobilePhoneOptionsOptions
Check if the string is a valid hex-encoded representation of a MongoDB ObjectId.
Check if the string contains one or more multibyte chars.
Check if the string contains only numbers.
Optional
options: IsNumericOptionsOptions
Check if the string is a valid octal number.
Check if the string is a valid passport number relative to a specific country code.
Optional
countryCode: stringCountry code
Check if the string is a valid port number.
Check if the string is a postal code
PostalCodeLocale
Check if the string is a valid RFC 3339 date.
Check if the string is a rgb or rgba color.
Optional
includePercentValues: booleanIf you don't want to allow to set rgb or rgba values with percents, like rgb(5%,5%,5%), or rgba(90%,90%,90%,.3), then set it to false. (defaults to true)
Check if the string is a Semantic Versioning Specification (SemVer).
Check if the string is of type slug.
Optional
options: StrongPasswordOptions & { Check if the string contains any surrogate pairs chars.
Validator function Return true if the passed string is a valid tax identification number for the specified locale. Throw an error exception if the locale is not supported.
Optional
locale: stringCheck if the string is a valid time.
Optional
options: IsTimeOptionsCheck if the string is an URL.
Optional
options: IsURLOptionsOptions
Check if the string is a UUID (version 1, 2, 3, 4 or 5).
Optional
version: UUIDVersionUUID version
Check if the string is uppercase.
Checks that the string is a [valid VAT number
Check if the string contains a mixture of full and half-width chars.
Checks characters if they appear in the whitelist.
whitelist
Name of the attribute
Check if string matches the pattern.
/foo/i
Check if string matches the pattern.
'foo'
Optional
modifiers: string'i'
Checks if the attribute is valid
Gets the value of the attribute
Value
Executes the given validation function to validate the value.
The value will be passed as the first parameter to the validation function and the library https://github.com/chriso/validator.js as the second one. If the function returns true the value is valid, otherwise it's invalid.
will be used to validate the value
Executes the given validation function to validate the value.
The value will be passed as the first parameter to the validation function and the library https://github.com/chriso/validator.js as the second one. If the function returns true the value is valid, otherwise it's invalid.
The error message which will be used if the value is invalid
will be used to validate the value
Static
compileCompiles the given validation code for the managedType
the parsed validation function
The managedType of the code
The validation code
Generated using TypeDoc
Check if the string contains the seed.