@types/validator

  • Version 13.6.3
  • Published
  • 57.1 kB
  • No dependencies
  • MIT license

Install

npm i @types/validator
yarn add @types/validator
pnpm add @types/validator

Overview

TypeScript definitions for validator.js

Index

Namespaces

Namespaces

namespace validator

namespace validator {}

    variable isAlphaLocales

    const isAlphaLocales: AlphaLocale[];

      variable isAlphanumericLocales

      const isAlphanumericLocales: AlphanumericLocale[];

        variable isFloatLocales

        const isFloatLocales: FloatLocale[];

          variable isMobilePhoneLocales

          const isMobilePhoneLocales: MobilePhoneLocale[];

            variable isPostalCodeLocales

            const isPostalCodeLocales: PostalCodeLocale[];

              variable version

              const version: string;

                function blacklist

                blacklist: (input: string, chars: string) => string;
                • Remove characters that appear in the blacklist.

                  Parameter chars

                  The characters are used in a RegExp and so you will need to escape some chars, e.g. blacklist(input, '\\[\\]').

                function contains

                contains: (str: string, seed: any) => boolean;
                • Check if the string contains the seed.

                  Parameter seed

                  Seed

                function equals

                equals: (str: string, comparison: string) => boolean;
                • Check if the string matches the comparison.

                  Parameter comparison

                  String to compare

                function escape

                escape: (input: string) => string;
                • Replace <, >, &, ', " and / with HTML entities.

                function isAfter

                isAfter: (str: string, date?: string) => boolean;
                • Check if the string is a date that's after the specified date.

                  Parameter date

                  Date string (defaults to now)

                function isAlpha

                isAlpha: (str: string, locale?: AlphaLocale) => boolean;
                • Check if the string contains only letters (a-zA-Z).

                  Parameter locale

                  AlphaLocale

                function isAlphanumeric

                isAlphanumeric: (
                str: string,
                locale?: AlphanumericLocale,
                options?: IsAlphanumericOptions
                ) => boolean;
                • Check if the string contains only letters and numbers.

                  Parameter locale

                  AlphanumericLocale

                  Parameter options

                  IsAlphanumericOptions

                function isAscii

                isAscii: (str: string) => boolean;
                • Check if the string contains ASCII chars only.

                function isBase32

                isBase32: (str: string) => boolean;
                • Check if a string is base32 encoded.

                function isBase58

                isBase58: (str: string) => boolean;
                • check if a string is base58 encoded

                function isBase64

                isBase64: (str: string, options?: IsBase64Options) => boolean;
                • Check if a string is base64 encoded.

                  Parameter options

                  Options

                function isBefore

                isBefore: (str: string, date?: string) => boolean;
                • Check if the string is a date that's before the specified date.

                  Parameter date

                  Date string (defaults to now)

                function isBIC

                isBIC: (str: string) => boolean;
                • Check if a string is a BIC (Bank Identification Code) or SWIFT code.

                function isBoolean

                isBoolean: (str: string) => boolean;
                • check if a string is a boolean.

                function isBtcAddress

                isBtcAddress: (str: string) => boolean;
                • Check if the string is a valid BTC address.

                function isByteLength

                isByteLength: (str: string, options?: IsByteLengthOptions) => boolean;
                • Check if the string's length (in UTF-8 bytes) falls in a range.

                  Parameter options

                  Options

                function isCreditCard

                isCreditCard: (str: string) => boolean;
                • Check if the string is a credit card.

                function isCurrency

                isCurrency: (str: string, options?: IsCurrencyOptions) => boolean;
                • Check if the string is a valid currency amount.

                  Parameter options

                  Options

                function isDataURI

                isDataURI: (str: string) => boolean;
                • Check if the string is a [data uri format](https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs).

                function isDate

                isDate: (str: string, options?: IsDateOptions) => boolean;
                • Check if the string is a valid date.

                function isDecimal

                isDecimal: (str: string, options?: IsDecimalOptions) => boolean;
                • Check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0 etc.

                  Parameter options

                  Options

                function isDivisibleBy

                isDivisibleBy: (str: string, number: number) => boolean;
                • Check if the string is a number that's divisible by another.

                  Parameter number

                  Divider number

                function isEAN

                isEAN: (str: string) => boolean;
                • Check if the string is an EAN (European Article Number).

                function isEmail

                isEmail: (str: string, options?: IsEmailOptions) => boolean;
                • Check if the string is an email.

                  Parameter options

                  Options

                function isEmpty

                isEmpty: (str: string, options?: IsEmptyOptions) => boolean;
                • Check if the string has a length of zero.

                  Parameter options

                  Options

                function isEthereumAddress

                isEthereumAddress: (str: string) => boolean;
                • Check if the string is an [Ethereum](https://ethereum.org/) address using basic regex. Does not validate address checksums.

                function isFloat

                isFloat: (str: string, options?: IsFloatOptions) => boolean;
                • Check if the string is a float.

                  Parameter options

                  Options

                function isFQDN

                isFQDN: (str: string, options?: IsFQDNOptions) => boolean;
                • Check if the string is a fully qualified domain name (e.g. domain.com).

                  Parameter options

                  Options

                function isFullWidth

                isFullWidth: (str: string) => boolean;
                • Check if the string contains any full-width chars.

                function isHalfWidth

                isHalfWidth: (str: string) => boolean;
                • Check if the string contains any half-width chars.

                function isHash

                isHash: (str: string, algorithm: HashAlgorithm) => boolean;
                • Check if the string is a hash of type algorithm.

                  Parameter algorithm

                  HashAlgorithm

                function isHexadecimal

                isHexadecimal: (str: string) => boolean;
                • Check if the string is a hexadecimal number.

                function isHexColor

                isHexColor: (str: string) => boolean;
                • Check if the string is a hexadecimal color.

                function isHSL

                isHSL: (str: string) => boolean;
                • 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)).

                function isIBAN

                isIBAN: (str: string) => boolean;
                • Check if a string is a IBAN (International Bank Account Number).

                function isIdentityCard

                isIdentityCard: (str: string, locale?: 'any' | IdentityCardLocale) => boolean;
                • Check if the string is a valid identity card code.

                  Parameter locale

                  IdentityCardLocale

                function isIn

                isIn: (str: string, values: any[]) => boolean;
                • Check if the string is in a array of allowed values.

                  Parameter values

                  Allowed values.

                function isInt

                isInt: (str: string, options?: IsIntOptions) => boolean;
                • Check if the string is an integer.

                  Parameter options

                  Options

                function isIP

                isIP: (str: string, version?: IPVersion) => boolean;
                • Check if the string is an IP (version 4 or 6).

                  Parameter version

                  IP Version

                function isIPRange

                isIPRange: (str: string, version?: IPVersion) => boolean;
                • Check if the string is an IP Range (version 4 or 6).

                function isISBN

                isISBN: (str: string, version?: ISBNVersion) => boolean;
                • Check if the string is an ISBN (version 10 or 13).

                  Parameter version

                  ISBN Version

                function isISIN

                isISIN: (str: string) => boolean;
                • Check if the string is an [ISIN](https://en.wikipedia.org/wiki/International_Securities_Identification_Number) (stock/security identifier).

                function isISO31661Alpha2

                isISO31661Alpha2: (str: string) => boolean;
                • Check if the string is a valid [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) officially assigned country code.

                function isISO31661Alpha3

                isISO31661Alpha3: (str: string) => boolean;
                • Check if the string is a valid [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) officially assigned country code.

                function isISO8601

                isISO8601: (str: string, options?: IsISO8601Options) => boolean;
                • Check if the string is a valid [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date.

                  Parameter options

                  Options

                function isISRC

                isISRC: (str: string) => boolean;
                • Check if the string is a [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code).

                function isISSN

                isISSN: (str: string, options?: IsISSNOptions) => boolean;
                • Check if the string is an [ISSN](https://en.wikipedia.org/wiki/International_Standard_Serial_Number).

                  Parameter options

                  Options

                function isJSON

                isJSON: (str: string) => boolean;
                • Check if the string is valid JSON (note: uses JSON.parse).

                function isJWT

                isJWT: (str: string) => boolean;
                • Check if the string is valid JWT token.

                function isLatLong

                isLatLong: (str: string) => boolean;
                • Check if the string is a valid latitude-longitude coordinate in the format:

                  lat,long or lat, long.

                function isLength

                isLength: (str: string, options?: IsLengthOptions) => boolean;
                • Check if the string's length falls in a range.

                  Note: this function takes into account surrogate pairs.

                  Parameter options

                  Options

                function isLocale

                isLocale: (str: string) => boolean;
                • Check if the string is a locale.

                function isLowercase

                isLowercase: (str: string) => boolean;
                • Check if the string is lowercase.

                function isMACAddress

                isMACAddress: (str: string, options?: IsMACAddressOptions) => boolean;
                • Check if the string is a MAC address.

                  Parameter options

                  Options

                function isMagnetURI

                isMagnetURI: (str: string) => boolean;
                • Check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme).

                function isMD5

                isMD5: (str: string) => boolean;
                • Check if the string is a MD5 hash.

                function isMimeType

                isMimeType: (str: string) => boolean;
                • Check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format.

                function isMobilePhone

                isMobilePhone: (
                str: string,
                locale?: 'any' | MobilePhoneLocale | MobilePhoneLocale[],
                options?: IsMobilePhoneOptions
                ) => boolean;
                • Check if the string is a mobile phone number.

                  Parameter locale

                  MobilePhoneLocale(s)

                  Parameter options

                  Options

                function isMongoId

                isMongoId: (str: string) => boolean;
                • Check if the string is a valid hex-encoded representation of a [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/).

                function isMultibyte

                isMultibyte: (str: string) => boolean;
                • Check if the string contains one or more multibyte chars.

                function isNumeric

                isNumeric: (str: string, options?: IsNumericOptions) => boolean;
                • Check if the string contains only numbers.

                  Parameter options

                  Options

                function isOctal

                isOctal: (str: string) => boolean;
                • Check if the string is a valid octal number.

                function isPassportNumber

                isPassportNumber: (str: string, countryCode?: string) => boolean;
                • Check if the string is a valid passport number relative to a specific country code.

                  Parameter countryCode

                  Country code

                function isPort

                isPort: (str: string) => boolean;
                • Check if the string is a valid port number.

                function isPostalCode

                isPostalCode: (str: string, locale: 'any' | PostalCodeLocale) => boolean;
                • Check if the string is a postal code

                  Parameter locale

                  PostalCodeLocale

                function isRFC3339

                isRFC3339: (str: string) => boolean;
                • Check if the string is a valid [RFC 3339](https://tools.ietf.org/html/rfc3339) date.

                function isRgbColor

                isRgbColor: (str: string, includePercentValues?: boolean) => boolean;
                • Check if the string is a rgb or rgba color.

                  Parameter includePercentValues

                  If 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)

                function isSemVer

                isSemVer: (str: string) => boolean;
                • Check if the string is a Semantic Versioning Specification (SemVer).

                function isSlug

                isSlug: (str: string) => boolean;
                • Check if the string is of type slug.

                function isStrongPassword

                isStrongPassword: (str: string, options?: strongPasswordOptions) => boolean;

                  function isSurrogatePair

                  isSurrogatePair: (str: string) => boolean;
                  • Check if the string contains any surrogate pairs chars.

                  function isUppercase

                  isUppercase: (str: string) => boolean;
                  • Check if the string is uppercase.

                  function isURL

                  isURL: (str: string, options?: IsURLOptions) => boolean;
                  • Check if the string is an URL.

                    Parameter options

                    Options

                  function isUUID

                  isUUID: (str: string, version?: UUIDVersion) => boolean;
                  • Check if the string is a UUID (version 3, 4 or 5).

                    Parameter version

                    UUID version

                  function isVariableWidth

                  isVariableWidth: (str: string) => boolean;
                  • Check if the string contains a mixture of full and half-width chars.

                  function isVAT

                  isVAT: (str: string, countryCode: string) => boolean;
                  • Checks that the string is a [valid VAT number

                  function isWhitelisted

                  isWhitelisted: (str: string, chars: string | string[]) => boolean;
                  • Checks characters if they appear in the whitelist.

                    Parameter chars

                    whitelist

                  function ltrim

                  ltrim: (input: string, chars?: string) => string;
                  • Trim characters from the left-side of the input.

                    Parameter chars

                    characters (defaults to whitespace)

                  function matches

                  matches: {
                  (str: string, pattern: RegExp): boolean;
                  (str: string, pattern: string, modifiers?: string): boolean;
                  };
                  • Check if string matches the pattern.

                    Parameter pattern

                    /foo/i

                  • Check if string matches the pattern.

                    Parameter pattern

                    'foo'

                    Parameter modifiers

                    'i'

                  function normalizeEmail

                  normalizeEmail: (
                  email: string,
                  options?: NormalizeEmailOptions
                  ) => string | false;
                  • Canonicalizes an email address. (This doesn't validate that the input is an email, if you want to validate the email use isEmail beforehand)

                    Parameter options

                    Options

                  function rtrim

                  rtrim: (input: string, chars?: string) => string;
                  • Trim characters from the right-side of the input.

                    Parameter chars

                    characters (defaults to whitespace)

                  function stripLow

                  stripLow: (input: string, keep_new_lines?: boolean) => string;
                  • Remove characters with a numerical value < 32 and 127, mostly control characters. Unicode-safe in JavaScript.

                    Parameter keep_new_lines

                    if true, newline characters are preserved (\n and \r, hex 0xA and 0xD).

                  function toBoolean

                  toBoolean: (input: string, strict?: boolean) => boolean;
                  • Convert the input string to a boolean. Everything except for '0', 'false' and '' returns true.

                    Parameter strict

                    in strict mode, only '1' and 'true' return true.

                  function toDate

                  toDate: (input: string) => Date | null;
                  • Convert the input string to a Date, or null if the input is not a date.

                  function toFloat

                  toFloat: (input: string) => number;
                  • Convert the input string to a float, or NaN if the input is not a float.

                  function toInt

                  toInt: (input: string, radix?: number) => number;
                  • Convert the input string to an integer, or NaN if the input is not an integer.

                    Parameter radix

                    radix or base (defaults to 10)

                  function toString

                  toString: (input: any) => string;
                  • Converts to string.

                  function trim

                  trim: (input: string, chars?: string) => string;
                  • Trim characters from both sides of the input.

                    Parameter chars

                    characters (defaults to whitespace)

                  function unescape

                  unescape: (input: string) => string;
                  • Replaces HTML encoded entities with <, >, &, ', " and /.

                  function whitelist

                  whitelist: (input: string, chars: string) => string;
                  • Remove characters that do not appear in the whitelist.

                    Parameter chars

                    The characters are used in a RegExp and so you will need to escape some chars, e.g. whitelist(input, '\\[\\]').

                  interface IsAlphanumericOptions

                  interface IsAlphanumericOptions {}

                    property ignore

                    ignore?: string | RegExp | undefined;
                    • undefined

                    interface IsBase64Options

                    interface IsBase64Options {}

                      property urlSafe

                      urlSafe?: boolean | undefined;
                      • false

                      interface IsByteLengthOptions

                      interface IsByteLengthOptions {}

                        property max

                        max?: number | undefined;
                        • undefined

                        property min

                        min?: number | undefined;
                        • 0

                        interface IsCurrencyOptions

                        interface IsCurrencyOptions {}

                          property allow_decimal

                          allow_decimal?: boolean | undefined;
                          • true

                          property allow_negative_sign_placeholder

                          allow_negative_sign_placeholder?: boolean | undefined;
                          • false

                          property allow_negatives

                          allow_negatives?: boolean | undefined;
                          • true

                          property allow_space_after_digits

                          allow_space_after_digits?: boolean | undefined;
                          • false

                          property allow_space_after_symbol

                          allow_space_after_symbol?: boolean | undefined;
                          • false

                          property decimal_separator

                          decimal_separator?: string | undefined;
                          • '.'

                          property digits_after_decimal

                          digits_after_decimal?: number[] | undefined;
                          • The array digits_after_decimal is filled with the exact number of digits allowed not a range, for example a range 1 to 3 will be given as [1, 2, 3].

                            [2]

                          property negative_sign_after_digits

                          negative_sign_after_digits?: boolean | undefined;
                          • false

                          property negative_sign_before_digits

                          negative_sign_before_digits?: boolean | undefined;
                          • false

                          property parens_for_negatives

                          parens_for_negatives?: boolean | undefined;
                          • false

                          property require_decimal

                          require_decimal?: boolean | undefined;
                          • false

                          property require_symbol

                          require_symbol?: boolean | undefined;
                          • false

                          property symbol

                          symbol?: string | undefined;
                          • '$'

                          property symbol_after_digits

                          symbol_after_digits?: boolean | undefined;
                          • false

                          property thousands_separator

                          thousands_separator?: string | undefined;
                          • ','

                          interface IsDateOptions

                          interface IsDateOptions {}

                            property delimiters

                            delimiters?: string[] | undefined;
                            • delimiters is an array of allowed date delimiters

                              ['/', '-']

                            property format

                            format?: string | undefined;
                            • false

                            property strictMode

                            strictMode?: boolean | undefined;
                            • If strictMode is set to true, the validator will reject inputs different from format.

                              false

                            interface IsDecimalOptions

                            interface IsDecimalOptions {}

                              property decimal_digits

                              decimal_digits?: string | undefined;
                              • decimal_digits is given as a range like '1,3', a specific value like '3' or min like '1,'

                                '1,'

                              property force_decimal

                              force_decimal?: boolean | undefined;
                              • false

                              property locale

                              locale?: DecimalLocale | undefined;
                              • DecimalLocale

                                'en-US'

                              interface IsEmailOptions

                              interface IsEmailOptions {}

                                property allow_display_name

                                allow_display_name?: boolean | undefined;
                                • If allow_display_name is set to true, the validator will also match Display Name <email-address>.

                                  false

                                property allow_ip_domain

                                allow_ip_domain?: boolean | undefined;
                                • If allow_ip_domain is set to true, the validator will allow IP addresses in the host part.

                                  false

                                property allow_utf8_local_part

                                allow_utf8_local_part?: boolean | undefined;
                                • If allow_utf8_local_part is set to false, the validator will not allow any non-English UTF8 character in email address' local part.

                                  true

                                property domain_specific_validation

                                domain_specific_validation?: boolean | undefined;
                                • If domain_specific_validation is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by GMail.

                                  false

                                property ignore_max_length

                                ignore_max_length?: boolean | undefined;
                                • If ignore_max_length is set to true, the validator will not check for the standard max length of an email.

                                  false

                                property require_display_name

                                require_display_name?: boolean | undefined;
                                • If require_display_name is set to true, the validator will reject strings without the format Display Name <email-address>.

                                  false

                                property require_tld

                                require_tld?: boolean | undefined;
                                • If require_tld is set to false, e-mail addresses without having TLD in their domain will also be matched.

                                  true

                                interface IsEmptyOptions

                                interface IsEmptyOptions {}

                                  property ignore_whitespace

                                  ignore_whitespace?: boolean | undefined;
                                  • false

                                  interface IsFloatOptions

                                  interface IsFloatOptions {}

                                    property gt

                                    gt?: number | undefined;
                                    • greater than

                                    property locale

                                    locale?: FloatLocale | undefined;
                                    • FloatLocale

                                    property lt

                                    lt?: number | undefined;
                                    • less than

                                    property max

                                    max?: number | undefined;
                                    • greater or equal

                                    property min

                                    min?: number | undefined;
                                    • less or equal

                                    interface IsFQDNOptions

                                    interface IsFQDNOptions {}

                                      property allow_trailing_dot

                                      allow_trailing_dot?: boolean | undefined;
                                      • false

                                      property allow_underscores

                                      allow_underscores?: boolean | undefined;
                                      • false

                                      property require_tld

                                      require_tld?: boolean | undefined;
                                      • true

                                      interface IsIntOptions

                                      interface IsIntOptions {}

                                        property allow_leading_zeroes

                                        allow_leading_zeroes?: boolean | undefined;
                                        • if false, will disallow integer values with leading zeroes true

                                        property gt

                                        gt?: number | undefined;
                                        • enforce integers being less than the value provided

                                        property lt

                                        lt?: number | undefined;
                                        • enforce integers being greater than the value provided

                                        property max

                                        max?: number | undefined;
                                        • to check the integer max boundary

                                        property min

                                        min?: number | undefined;
                                        • to check the integer min boundary

                                        interface IsISO8601Options

                                        interface IsISO8601Options {}

                                          property strict

                                          strict?: boolean | undefined;
                                          • If strict is true, performs additional checks for valid dates, e.g. invalidates dates like 2009-02-29.

                                            false

                                          interface IsISSNOptions

                                          interface IsISSNOptions {}

                                            property case_sensitive

                                            case_sensitive?: boolean | undefined;
                                            • If case_sensitive is true, ISSNs with a lowercase x as the check digit are rejected.

                                              false

                                            property require_hyphen

                                            require_hyphen?: boolean | undefined;
                                            • false

                                            interface IsLengthOptions

                                            interface IsLengthOptions {}

                                              property max

                                              max?: number | undefined;
                                              • undefined

                                              property min

                                              min?: number | undefined;
                                              • 0

                                              interface IsMACAddressOptions

                                              interface IsMACAddressOptions {}

                                                property no_colons

                                                no_colons?: boolean | undefined;
                                                • If no_colons is true, the validator will allow MAC addresses without the colons. Also, it allows the use of hyphens or spaces.

                                                  e.g. 01 02 03 04 05 ab or 01-02-03-04-05-ab.

                                                  false

                                                interface IsMobilePhoneOptions

                                                interface IsMobilePhoneOptions {}

                                                  property strictMode

                                                  strictMode?: boolean | undefined;
                                                  • If this is set to true, the mobile phone number must be supplied with the country code and therefore must start with +.

                                                    false

                                                  interface IsNumericOptions

                                                  interface IsNumericOptions {}

                                                    property no_symbols

                                                    no_symbols?: boolean | undefined;
                                                    • If no_symbols is true, the validator will reject numeric strings that feature a symbol (e.g. +, -, or .).

                                                      false

                                                    interface IsURLOptions

                                                    interface IsURLOptions {}

                                                      property allow_protocol_relative_urls

                                                      allow_protocol_relative_urls?: boolean | undefined;
                                                      • false

                                                      property allow_trailing_dot

                                                      allow_trailing_dot?: boolean | undefined;
                                                      • false

                                                      property allow_underscores

                                                      allow_underscores?: boolean | undefined;
                                                      • false

                                                      property disallow_auth

                                                      disallow_auth?: boolean | undefined;
                                                      • false

                                                      property host_blacklist

                                                      host_blacklist?: Array<string | RegExp> | undefined;
                                                      • false

                                                      property host_whitelist

                                                      host_whitelist?: Array<string | RegExp> | undefined;
                                                      • false

                                                      property protocols

                                                      protocols?: string[] | undefined;
                                                      • ['http','https','ftp']

                                                      property require_host

                                                      require_host?: boolean | undefined;
                                                      • true

                                                      property require_port

                                                      require_port?: boolean | undefined;
                                                      • if set as true isURL will check if port is present in the URL false

                                                      property require_protocol

                                                      require_protocol?: boolean | undefined;
                                                      • false

                                                      property require_tld

                                                      require_tld?: boolean | undefined;
                                                      • true

                                                      property require_valid_protocol

                                                      require_valid_protocol?: boolean | undefined;
                                                      • true

                                                      interface NormalizeEmailOptions

                                                      interface NormalizeEmailOptions {}

                                                        property all_lowercase

                                                        all_lowercase?: boolean | undefined;
                                                        • Transforms the local part (before the @ symbol) of all email addresses to lowercase. Please note that this may violate RFC 5321, which gives providers the possibility to treat the local part of email addresses in a case sensitive way (although in practice most - yet not all - providers don't). The domain part of the email address is always lowercased, as it's case insensitive per RFC 1035.

                                                          true

                                                        property gmail_convert_googlemaildotcom

                                                        gmail_convert_googlemaildotcom?: boolean | undefined;
                                                        • Converts addresses with domain @googlemail.com to @gmail.com, as they're equivalent.

                                                          true

                                                        property gmail_lowercase

                                                        gmail_lowercase?: boolean | undefined;
                                                        • GMail addresses are known to be case-insensitive, so this switch allows lowercasing them even when all_lowercase is set to false. Please note that when all_lowercase is true, GMail addresses are lowercased regardless of the value of this setting.

                                                          true

                                                        property gmail_remove_dots

                                                        gmail_remove_dots?: boolean | undefined;
                                                        • Removes dots from the local part of the email address, as GMail ignores them (e.g. "john.doe" and "johndoe" are considered equal).

                                                          true

                                                        property gmail_remove_subaddress

                                                        gmail_remove_subaddress?: boolean | undefined;
                                                        • Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@gmail.com" becomes "foo@gmail.com").

                                                          true

                                                        property icloud_lowercase

                                                        icloud_lowercase?: boolean | undefined;
                                                        • iCloud addresses (including MobileMe) are known to be case-insensitive, so this switch allows lowercasing them even when all_lowercase is set to false. Please note that when all_lowercase is true, iCloud addresses are lowercased regardless of the value of this setting.

                                                          true

                                                        property icloud_remove_subaddress

                                                        icloud_remove_subaddress?: boolean | undefined;
                                                        • Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@icloud.com" becomes "foo@icloud.com").

                                                          true

                                                        property outlookdotcom_lowercase

                                                        outlookdotcom_lowercase?: boolean | undefined;
                                                        • Outlook.com addresses (including Windows Live and Hotmail) are known to be case-insensitive, so this switch allows lowercasing them even when all_lowercase is set to false. Please note that when all_lowercase is true, Outlook.com addresses are lowercased regardless of the value of this setting.

                                                          true

                                                        property outlookdotcom_remove_subaddress

                                                        outlookdotcom_remove_subaddress?: boolean | undefined;
                                                        • Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@outlook.com" becomes "foo@outlook.com").

                                                          true

                                                        property yahoo_lowercase

                                                        yahoo_lowercase?: boolean | undefined;
                                                        • Yahoo Mail addresses are known to be case-insensitive, so this switch allows lowercasing them even when all_lowercase is set to false. Please note that when all_lowercase is true, Yahoo Mail addresses are lowercased regardless of the value of this setting.

                                                          true

                                                        property yahoo_remove_subaddress

                                                        yahoo_remove_subaddress?: boolean | undefined;
                                                        • Normalizes addresses by removing "sub-addresses", which is the part following a "-" sign (e.g. "foo-bar@yahoo.com" becomes "foo@yahoo.com").

                                                          true

                                                        interface strongPasswordOptions

                                                        interface strongPasswordOptions {}
                                                        • Check if string is considered a strong password. Allows options to be added

                                                        property minLength

                                                        minLength?: number | undefined;

                                                          property minLowercase

                                                          minLowercase?: number | undefined;

                                                            property minNumbers

                                                            minNumbers?: number | undefined;

                                                              property minSymbols

                                                              minSymbols?: number | undefined;

                                                                property minUppercase

                                                                minUppercase?: number | undefined;

                                                                  property pointsForContainingLower

                                                                  pointsForContainingLower?: number | undefined;

                                                                    property pointsForContainingNumber

                                                                    pointsForContainingNumber?: number | undefined;

                                                                      property pointsForContainingSymbol

                                                                      pointsForContainingSymbol?: number | undefined;

                                                                        property pointsForContainingUpper

                                                                        pointsForContainingUpper?: number | undefined;

                                                                          property pointsPerRepeat

                                                                          pointsPerRepeat?: number | undefined;

                                                                            property pointsPerUnique

                                                                            pointsPerUnique?: number | undefined;

                                                                              property returnScore

                                                                              returnScore?: boolean | undefined;

                                                                                type AlphaLocale

                                                                                type AlphaLocale =
                                                                                | 'en-US'
                                                                                | 'bg-BG'
                                                                                | 'cs-CZ'
                                                                                | 'da-DK'
                                                                                | 'de-DE'
                                                                                | 'el-GR'
                                                                                | 'es-AR'
                                                                                | 'es-ES'
                                                                                | 'fr-FR'
                                                                                | 'it-IT'
                                                                                | 'nb-NO'
                                                                                | 'nl-NL'
                                                                                | 'nn-NO'
                                                                                | 'hu-HU'
                                                                                | 'pl-PL'
                                                                                | 'pt-PT'
                                                                                | 'ru-RU'
                                                                                | 'sl-SI'
                                                                                | 'sk-SK'
                                                                                | 'sr-RS@latin'
                                                                                | 'sr-RS'
                                                                                | 'sv-SE'
                                                                                | 'tr-TR'
                                                                                | 'uk-UA'
                                                                                | 'ku-IQ'
                                                                                | 'ar'
                                                                                | 'he'
                                                                                | 'fa-IR'
                                                                                | 'en-AU'
                                                                                | 'en-GB'
                                                                                | 'en-HK'
                                                                                | 'en-IN'
                                                                                | 'en-NZ'
                                                                                | 'en-ZA'
                                                                                | 'en-ZM'
                                                                                | 'ar-AE'
                                                                                | 'ar-BH'
                                                                                | 'ar-DZ'
                                                                                | 'ar-EG'
                                                                                | 'ar-IQ'
                                                                                | 'ar-JO'
                                                                                | 'ar-KW'
                                                                                | 'ar-LB'
                                                                                | 'ar-LY'
                                                                                | 'ar-MA'
                                                                                | 'ar-QM'
                                                                                | 'ar-QA'
                                                                                | 'ar-SA'
                                                                                | 'ar-SD'
                                                                                | 'ar-SY'
                                                                                | 'ar-TN'
                                                                                | 'ar-YE'
                                                                                | 'pt-BR'
                                                                                | 'pl-Pl';

                                                                                  type AlphanumericLocale

                                                                                  type AlphanumericLocale =
                                                                                  | 'en-US'
                                                                                  | 'bg-BG'
                                                                                  | 'cs-CZ'
                                                                                  | 'da-DK'
                                                                                  | 'de-DE'
                                                                                  | 'el-GR'
                                                                                  | 'es-AR'
                                                                                  | 'es-ES'
                                                                                  | 'fr-FR'
                                                                                  | 'it-IT'
                                                                                  | 'hu-HU'
                                                                                  | 'nb-NO'
                                                                                  | 'nl-NL'
                                                                                  | 'nn-NO'
                                                                                  | 'pl-PL'
                                                                                  | 'pt-PT'
                                                                                  | 'ru-RU'
                                                                                  | 'sl-SI'
                                                                                  | 'sk-SK'
                                                                                  | 'sr-RS@latin'
                                                                                  | 'sr-RS'
                                                                                  | 'sv-SE'
                                                                                  | 'tr-TR'
                                                                                  | 'uk-UA'
                                                                                  | 'ku-IQ'
                                                                                  | 'ar'
                                                                                  | 'he'
                                                                                  | 'fa-IR'
                                                                                  | 'en-AU'
                                                                                  | 'en-GB'
                                                                                  | 'en-HK'
                                                                                  | 'en-IN'
                                                                                  | 'en-NZ'
                                                                                  | 'en-ZA'
                                                                                  | 'en-ZM'
                                                                                  | 'ar-AE'
                                                                                  | 'ar-BH'
                                                                                  | 'ar-DZ'
                                                                                  | 'ar-EG'
                                                                                  | 'ar-IQ'
                                                                                  | 'ar-JO'
                                                                                  | 'ar-KW'
                                                                                  | 'ar-LB'
                                                                                  | 'ar-LY'
                                                                                  | 'ar-MA'
                                                                                  | 'ar-QM'
                                                                                  | 'ar-QA'
                                                                                  | 'ar-SA'
                                                                                  | 'ar-SD'
                                                                                  | 'ar-SY'
                                                                                  | 'ar-TN'
                                                                                  | 'ar-YE'
                                                                                  | 'pt-BR'
                                                                                  | 'pl-Pl';

                                                                                    type DecimalLocale

                                                                                    type DecimalLocale = FloatLocale;

                                                                                      type FloatLocale

                                                                                      type FloatLocale =
                                                                                      | 'en-US'
                                                                                      | 'ar'
                                                                                      | 'en-AU'
                                                                                      | 'en-GB'
                                                                                      | 'en-HK'
                                                                                      | 'en-IN'
                                                                                      | 'en-NZ'
                                                                                      | 'en-ZA'
                                                                                      | 'en-ZM'
                                                                                      | 'ar-AE'
                                                                                      | 'ar-BH'
                                                                                      | 'ar-DZ'
                                                                                      | 'ar-EG'
                                                                                      | 'ar-IQ'
                                                                                      | 'ar-JO'
                                                                                      | 'ar-KW'
                                                                                      | 'ar-LB'
                                                                                      | 'ar-LY'
                                                                                      | 'ar-MA'
                                                                                      | 'ar-QM'
                                                                                      | 'ar-QA'
                                                                                      | 'ar-SA'
                                                                                      | 'ar-SD'
                                                                                      | 'ar-SY'
                                                                                      | 'ar-TN'
                                                                                      | 'ar-YE'
                                                                                      | 'bg-BG'
                                                                                      | 'cs-CZ'
                                                                                      | 'da-DK'
                                                                                      | 'de-DE'
                                                                                      | 'el-GR'
                                                                                      | 'es-ES'
                                                                                      | 'fr-FR'
                                                                                      | 'it-IT'
                                                                                      | 'ku-IQ'
                                                                                      | 'hu-HU'
                                                                                      | 'nb-NO'
                                                                                      | 'nn-NO'
                                                                                      | 'nl-NL'
                                                                                      | 'pl-PL'
                                                                                      | 'pt-PT'
                                                                                      | 'ru-RU'
                                                                                      | 'sl-SI'
                                                                                      | 'sr-RS@latin'
                                                                                      | 'sr-RS'
                                                                                      | 'sv-SE'
                                                                                      | 'tr-TR'
                                                                                      | 'uk-UA'
                                                                                      | 'pt-BR'
                                                                                      | 'pl-Pl';

                                                                                        type HashAlgorithm

                                                                                        type HashAlgorithm =
                                                                                        | 'md4'
                                                                                        | 'md5'
                                                                                        | 'sha1'
                                                                                        | 'sha256'
                                                                                        | 'sha384'
                                                                                        | 'sha512'
                                                                                        | 'ripemd128'
                                                                                        | 'ripemd160'
                                                                                        | 'tiger128'
                                                                                        | 'tiger160'
                                                                                        | 'tiger192'
                                                                                        | 'crc32'
                                                                                        | 'crc32b';

                                                                                          type IdentityCardLocale

                                                                                          type IdentityCardLocale = 'ES' | 'he-IL' | 'zh-TW';

                                                                                            type IPVersion

                                                                                            type IPVersion = '4' | '6' | 4 | 6;

                                                                                              type ISBNVersion

                                                                                              type ISBNVersion = '10' | '13' | 10 | 13;

                                                                                                type MobilePhoneLocale

                                                                                                type MobilePhoneLocale =
                                                                                                | 'ar-AE'
                                                                                                | 'ar-BH'
                                                                                                | 'ar-DZ'
                                                                                                | 'ar-EG'
                                                                                                | 'ar-IQ'
                                                                                                | 'ar-JO'
                                                                                                | 'ar-KW'
                                                                                                | 'ar-SA'
                                                                                                | 'ar-SY'
                                                                                                | 'ar-TN'
                                                                                                | 'be-BY'
                                                                                                | 'bg-BG'
                                                                                                | 'bn-BD'
                                                                                                | 'cs-CZ'
                                                                                                | 'da-DK'
                                                                                                | 'de-DE'
                                                                                                | 'de-AT'
                                                                                                | 'el-GR'
                                                                                                | 'en-AU'
                                                                                                | 'en-GB'
                                                                                                | 'en-GG'
                                                                                                | 'en-GH'
                                                                                                | 'en-HK'
                                                                                                | 'en-IE'
                                                                                                | 'en-IN'
                                                                                                | 'en-KE'
                                                                                                | 'en-MT'
                                                                                                | 'en-MU'
                                                                                                | 'en-NG'
                                                                                                | 'en-NZ'
                                                                                                | 'en-PK'
                                                                                                | 'en-RW'
                                                                                                | 'en-SG'
                                                                                                | 'en-TZ'
                                                                                                | 'en-UG'
                                                                                                | 'en-US'
                                                                                                | 'en-ZA'
                                                                                                | 'en-ZM'
                                                                                                | 'es-CL'
                                                                                                | 'es-ES'
                                                                                                | 'es-MX'
                                                                                                | 'es-PA'
                                                                                                | 'es-PY'
                                                                                                | 'es-UY'
                                                                                                | 'et-EE'
                                                                                                | 'fa-IR'
                                                                                                | 'fi-FI'
                                                                                                | 'fj-FJ'
                                                                                                | 'fo-FO'
                                                                                                | 'fr-FR'
                                                                                                | 'fr-GF'
                                                                                                | 'fr-GP'
                                                                                                | 'fr-MQ'
                                                                                                | 'fr-RE'
                                                                                                | 'he-IL'
                                                                                                | 'hu-HU'
                                                                                                | 'id-ID'
                                                                                                | 'it-IT'
                                                                                                | 'ja-JP'
                                                                                                | 'kk-KZ'
                                                                                                | 'kl-GL'
                                                                                                | 'ko-KR'
                                                                                                | 'lt-LT'
                                                                                                | 'ms-MY'
                                                                                                | 'nb-NO'
                                                                                                | 'nl-BE'
                                                                                                | 'nl-NL'
                                                                                                | 'nn-NO'
                                                                                                | 'pl-PL'
                                                                                                | 'pt-BR'
                                                                                                | 'pt-PT'
                                                                                                | 'ro-RO'
                                                                                                | 'ru-RU'
                                                                                                | 'sl-SI'
                                                                                                | 'sk-SK'
                                                                                                | 'sr-RS'
                                                                                                | 'sv-SE'
                                                                                                | 'th-TH'
                                                                                                | 'tr-TR'
                                                                                                | 'uk-UA'
                                                                                                | 'vi-VN'
                                                                                                | 'zh-CN'
                                                                                                | 'zh-TW'
                                                                                                | 'en-CA'
                                                                                                | 'fr-BE'
                                                                                                | 'zh-HK';

                                                                                                  type PostalCodeLocale

                                                                                                  type PostalCodeLocale =
                                                                                                  | 'AD'
                                                                                                  | 'AT'
                                                                                                  | 'AU'
                                                                                                  | 'BE'
                                                                                                  | 'BG'
                                                                                                  | 'BR'
                                                                                                  | 'CA'
                                                                                                  | 'CH'
                                                                                                  | 'CZ'
                                                                                                  | 'DE'
                                                                                                  | 'DK'
                                                                                                  | 'DZ'
                                                                                                  | 'EE'
                                                                                                  | 'ES'
                                                                                                  | 'FI'
                                                                                                  | 'FR'
                                                                                                  | 'GB'
                                                                                                  | 'GR'
                                                                                                  | 'HR'
                                                                                                  | 'HU'
                                                                                                  | 'ID'
                                                                                                  | 'IE'
                                                                                                  | 'IL'
                                                                                                  | 'IN'
                                                                                                  | 'IS'
                                                                                                  | 'IT'
                                                                                                  | 'JP'
                                                                                                  | 'KE'
                                                                                                  | 'LI'
                                                                                                  | 'LT'
                                                                                                  | 'LU'
                                                                                                  | 'LV'
                                                                                                  | 'MX'
                                                                                                  | 'MT'
                                                                                                  | 'NL'
                                                                                                  | 'NO'
                                                                                                  | 'NZ'
                                                                                                  | 'PL'
                                                                                                  | 'PR'
                                                                                                  | 'PT'
                                                                                                  | 'RO'
                                                                                                  | 'RU'
                                                                                                  | 'SA'
                                                                                                  | 'SE'
                                                                                                  | 'SI'
                                                                                                  | 'SK'
                                                                                                  | 'TN'
                                                                                                  | 'TW'
                                                                                                  | 'UA'
                                                                                                  | 'US'
                                                                                                  | 'ZA'
                                                                                                  | 'ZM';

                                                                                                    type UUIDVersion

                                                                                                    type UUIDVersion = 3 | 4 | 5 | '3' | '4' | '5' | 'all';

                                                                                                      Package Files (1)

                                                                                                      Dependencies (0)

                                                                                                      No dependencies.

                                                                                                      Dev Dependencies (0)

                                                                                                      No dev dependencies.

                                                                                                      Peer Dependencies (0)

                                                                                                      No peer dependencies.

                                                                                                      Badge

                                                                                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/validator.

                                                                                                      • Markdown
                                                                                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/validator)
                                                                                                      • HTML
                                                                                                        <a href="https://www.jsdocs.io/package/@types/validator"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>