@types/validator
Advanced tools
Comparing version 10.11.3 to 12.0.0
@@ -1,3 +0,3 @@ | ||
// Type definitions for validator.js v10.11.0 | ||
// Project: https://github.com/chriso/validator.js | ||
// Type definitions for validator.js 12.0 | ||
// Project: https://github.com/validatorjs/validator.js | ||
// Definitions by: tgfjt <https://github.com/tgfjt> | ||
@@ -12,414 +12,1239 @@ // Ilya Mochalov <https://github.com/chrootsu> | ||
// Jace Warren <https://github.com/keatz55> | ||
// Munif Tanjim <https://github.com/MunifTanjim> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.1 | ||
declare namespace ValidatorJS { | ||
type AlphaLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "bg-BG" | "cs-CZ" | "da-DK" | "de-DE" | "el-GR" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sk-SK" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA"; | ||
type AlphanumericLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "bg-BG"| "cs-CZ" | "da-DK" | "de-DE" | "el-GR" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sk-SK" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA"; | ||
type DecimalLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "bg-BG" | "cs-CZ" | "da-DK" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA"; | ||
type FloatLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "bg-BG" | "cs-CZ" | "da-DK" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA"; | ||
type MobilePhoneLocale = "ar-AE" | "ar-DZ" | "ar-EG" | "ar-JO" | "ar-SA" | "ar-SY" | "be-BY" | "bg-BG" | "cs-CZ" | "de-DE" | "da-DK" | "el-GR" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-KE" | "en-NG" | "en-NZ" | "en-UG" | "en-RW" | "en-SG" | "en-TZ" | "en-PK" | "en-US" | "en-CA" | "en-ZA" | "en-ZM" | "es-ES" | "fa-IR" | "fi-FI" | "fo-FO" | "fr-FR" | "he-IL" | "hu-HU" | "id-ID" | "it-IT" | "ja-JP" | "kk-KZ" | "kl-GL" | "ko-KR" | "lt-LT" | "ms-MY" | "nb-NO" | "nn-NO" | "pl-PL" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sr-RS" | "th-TH" | "tr-TR" | "uk-UA" | "vi-VN" | "zh-CN" | "zh-HK" | "zh-TW" | "any"; | ||
type PostalCodeLocale = "AT" | "AU" | "BE" | "BG" | "CA" | "CH" | "CZ" | "DE" | "DK" | "DZ" | "ES" | "FI" | "FR" | "GB" | "GR" | "IL" | "IN" | "IS" | "IT" | "JP" | "KE" | "LI" | "MX" | "NL" | "NO" | "PL" | "PT" | "RO" | "RU" | "SA" | "SE" | "TW" | "US" | "ZA" | "ZM" | "any" | ||
type HashAlgorithm = "md4" | "md5" | "sha1" | "sha256" | "sha384" | "sha512" | "ripemd128" | "ripemd160" | "tiger128" | "tiger160" | "tiger192" | "crc32" | "crc32b"; | ||
export const version: string; | ||
interface ValidatorStatic { | ||
/****************** | ||
*** Validators *** | ||
******************/ | ||
// ************** | ||
// * Validators * | ||
// ************** | ||
/** | ||
* Check if the string contains the seed. | ||
* | ||
* @param seed - Seed | ||
*/ | ||
export function contains(str: string, seed: any): boolean; | ||
// check if the string contains the seed. | ||
contains(str: string, elem: any): boolean; | ||
/** | ||
* Check if the string matches the comparison. | ||
* | ||
* @param comparison - String to compare | ||
*/ | ||
export function equals(str: string, comparison: string): boolean; | ||
// check if the string matches the comparison. | ||
equals(str: string, comparison: string): boolean; | ||
/** | ||
* Check if the string is a date that's after the specified date. | ||
* | ||
* @param [date] - Date string (defaults to now) | ||
*/ | ||
export function isAfter(str: string, date?: string): boolean; | ||
// check if the string is a date that's after the specified date (defaults to now). | ||
isAfter(str: string, date?: string): boolean; | ||
export type AlphaLocale = | ||
| 'en-US' | ||
| 'bg-BG' | ||
| 'cs-CZ' | ||
| 'da-DK' | ||
| 'de-DE' | ||
| 'el-GR' | ||
| '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'; | ||
// check if the string contains only letters (a-zA-Z). Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', | ||
// 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', | ||
// 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', | ||
// 'es-ES', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'sr-RS', | ||
// 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']) and defaults to en-US | ||
isAlpha(str: string, locale?: AlphaLocale): boolean; | ||
export const isAlphaLocales: AlphaLocale[]; | ||
// check if the string contains only letters and numbers. Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', | ||
// 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', | ||
// 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', | ||
// 'es-ES', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'sr-RS', | ||
// 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']) and defaults to en-US | ||
isAlphanumeric(str: string, locale?: AlphanumericLocale): boolean; | ||
/** | ||
* Check if the string contains only letters (a-zA-Z). | ||
* | ||
* @param [locale] - AlphaLocale | ||
*/ | ||
export function isAlpha(str: string, locale?: AlphaLocale): boolean; | ||
// check if the string contains ASCII chars only. | ||
isAscii(str: string): boolean; | ||
export type AlphanumericLocale = | ||
| 'en-US' | ||
| 'bg-BG' | ||
| 'cs-CZ' | ||
| 'da-DK' | ||
| 'de-DE' | ||
| 'el-GR' | ||
| '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'; | ||
// check if a string is base64 encoded. | ||
isBase64(str: string): boolean; | ||
export const isAlphanumericLocales: AlphanumericLocale[]; | ||
// check if the string is a date that's before the specified date. | ||
isBefore(str: string, date?: string): boolean; | ||
/** | ||
* Check if the string contains only letters and numbers. | ||
* | ||
* @param [locale] - AlphanumericLocale | ||
*/ | ||
export function isAlphanumeric(str: string, locale?: AlphanumericLocale): boolean; | ||
// check if a string is a boolean. | ||
isBoolean(str: string): boolean; | ||
/** | ||
* Check if the string contains ASCII chars only. | ||
*/ | ||
export function isAscii(str: string): boolean; | ||
// check if the string's length (in bytes) falls in a range. | ||
isByteLength(str: string, options: IsByteLengthOptions): boolean; | ||
isByteLength(str: string, min: number, max?: number): boolean; | ||
/** | ||
* Check if a string is base32 encoded. | ||
*/ | ||
export function isBase32(str: string): boolean; | ||
// check if the string is a credit card. | ||
isCreditCard(str: string): boolean; | ||
/** | ||
* Check if a string is base64 encoded. | ||
*/ | ||
export function isBase64(str: string): boolean; | ||
// check if the string is a valid currency amount. | ||
isCurrency(str: string, options?: IsCurrencyOptions): boolean; | ||
/** | ||
* Check if the string is a date that's before the specified date. | ||
* | ||
* @param [date] - Date string (defaults to now) | ||
*/ | ||
export function isBefore(str: string, date?: string): boolean; | ||
// check if the string is a data uri format (https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs) | ||
isDataURI(str: string): boolean; | ||
/** | ||
* Check if a string is a BIC (Bank Identification Code) or SWIFT code. | ||
*/ | ||
export function isBIC(str: string): boolean; | ||
// check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc. | ||
isDecimal(str: string, options?: IsDecimalOptions): boolean; | ||
/** | ||
* check if a string is a boolean. | ||
*/ | ||
export function isBoolean(str: string): boolean; | ||
// check if the string is a number that's divisible by another. | ||
isDivisibleBy(str: string, number: number): boolean; | ||
export interface IsByteLengthOptions { | ||
/** | ||
* @default 0 | ||
*/ | ||
min?: number; | ||
/** | ||
* @default undefined | ||
*/ | ||
max?: number; | ||
} | ||
// check if the string is an email. | ||
isEmail(str: string, options?: IsEmailOptions): boolean; | ||
/** | ||
* Check if the string's length (in UTF-8 bytes) falls in a range. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isByteLength(str: string, options?: IsByteLengthOptions): boolean; | ||
// check if the string has a length of zero. | ||
isEmpty(str: string, options?: IsEmptyOptions): boolean; | ||
/** | ||
* Check if the string is a credit card. | ||
*/ | ||
export function isCreditCard(str: string): boolean; | ||
// check if the string is a fully qualified domain name (e.g. domain.com). | ||
isFQDN(str: string, options?: IsFQDNOptions): boolean; | ||
export interface IsCurrencyOptions { | ||
/** | ||
* @default '$' | ||
*/ | ||
symbol?: string; | ||
/** | ||
* @default false | ||
*/ | ||
require_symbol?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_space_after_symbol?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
symbol_after_digits?: boolean; | ||
/** | ||
* @default true | ||
*/ | ||
allow_negatives?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
parens_for_negatives?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
negative_sign_before_digits?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
negative_sign_after_digits?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_negative_sign_placeholder?: boolean; | ||
/** | ||
* @default ',' | ||
*/ | ||
thousands_separator?: string; | ||
/** | ||
* @default '.' | ||
*/ | ||
decimal_separator?: string; | ||
/** | ||
* @default true | ||
*/ | ||
allow_decimal?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
require_decimal?: boolean; | ||
/** | ||
* 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]`. | ||
* | ||
* @default [2] | ||
*/ | ||
digits_after_decimal?: number[]; | ||
/** | ||
* @default false | ||
*/ | ||
allow_space_after_digits?: boolean; | ||
} | ||
// check if the string is a float. | ||
isFloat(str: string, options?: IsFloatOptions): boolean; | ||
/** | ||
* Check if the string is a valid currency amount. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isCurrency(str: string, options?: IsCurrencyOptions): boolean; | ||
// check if the string contains any full-width chars. | ||
isFullWidth(str: string): boolean; | ||
/** | ||
* Check if the string is a [data uri format](https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs). | ||
*/ | ||
export function isDataURI(str: string): boolean; | ||
// check if the string contains any half-width chars. | ||
isHalfWidth(str: string): boolean; | ||
export type DecimalLocale = FloatLocale; | ||
// check if the string is a hash of type algorithm. | ||
// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', | ||
// 'tiger160', 'tiger192', 'crc32', 'crc32b'] | ||
isHash(str: string, algorithm: HashAlgorithm): boolean; | ||
export interface IsDecimalOptions { | ||
/** | ||
* @default false | ||
*/ | ||
force_decimal?: boolean; | ||
/** | ||
* `decimal_digits` is given as a range like `'1,3'`, | ||
* a specific value like `'3'` or min like `'1,'` | ||
* | ||
* @default '1,' | ||
*/ | ||
decimal_digits?: string; | ||
/** | ||
* DecimalLocale | ||
* | ||
* @default 'en-US' | ||
*/ | ||
locale?: DecimalLocale; | ||
} | ||
// check if the string is a hexadecimal color. | ||
isHexColor(str: string): boolean; | ||
/** | ||
* Check if the string represents a decimal number, | ||
* such as `0.1`, `.3`, `1.1`, `1.00003`, `4.0` etc. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isDecimal(str: string, options?: IsDecimalOptions): boolean; | ||
// check if the string is a hexadecimal number. | ||
isHexadecimal(str: string): boolean; | ||
/** | ||
* Check if the string is a number that's divisible by another. | ||
* | ||
* @param number - Divider number | ||
*/ | ||
export function isDivisibleBy(str: string, number: number): boolean; | ||
// check if the string is an IP (version 4 or 6). | ||
isIP(str: string, version?: number): boolean; | ||
export interface IsEmailOptions { | ||
/** | ||
* If `allow_display_name` is set to `true`, the validator will also match `Display Name <email-address>`. | ||
* | ||
* @default false | ||
*/ | ||
allow_display_name?: boolean; | ||
/** | ||
* If `require_display_name` is set to `true`, the validator will reject strings without the format `Display Name <email-address>`. | ||
* | ||
* @default false | ||
*/ | ||
require_display_name?: boolean; | ||
/** | ||
* If `allow_utf8_local_part` is set to `false`, the validator will not allow any non-English UTF8 character in email address' local part. | ||
* | ||
* @default true | ||
*/ | ||
allow_utf8_local_part?: boolean; | ||
/** | ||
* If `require_tld` is set to `false`, e-mail addresses without having TLD in their domain will also be matched. | ||
* | ||
* @default true | ||
*/ | ||
require_tld?: boolean; | ||
/** | ||
* If `ignore_max_length` is set to `true`, the validator will not check for the standard max length of an email. | ||
* | ||
* @default false | ||
*/ | ||
ignore_max_length?: boolean; | ||
/** | ||
* If `allow_ip_domain` is set to `true`, the validator will allow IP addresses in the host part. | ||
* | ||
* @default false | ||
*/ | ||
allow_ip_domain?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* @default false | ||
*/ | ||
domain_specific_validation?: boolean; | ||
} | ||
// check if the string is an ISBN (version 10 or 13). | ||
isISBN(str: string, version?: number): boolean; | ||
/** | ||
* Check if the string is an email. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isEmail(str: string, options?: IsEmailOptions): boolean; | ||
// check if the string is an ISSN (https://en.wikipedia.org/wiki/International_Standard_Serial_Number). | ||
isISSN(str: string, options?: IsISSNOptions): boolean; | ||
export interface IsEmptyOptions { | ||
/** | ||
* @default false | ||
*/ | ||
ignore_whitespace?: boolean; | ||
} | ||
// check if the string is an ISIN (https://en.wikipedia.org/wiki/International_Securities_Identification_Number) | ||
// (stock/security identifier). | ||
isISIN(str: string): boolean; | ||
/** | ||
* Check if the string has a length of zero. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isEmpty(str: string, options?: IsEmptyOptions): boolean; | ||
// check if the string is a valid ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) date. | ||
isISO8601(str: string, options?: IsISO8601Options): boolean; | ||
export 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'; | ||
// 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. | ||
isISO31661Alpha2(str: string): boolean; | ||
export const isFloatLocales: FloatLocale[]; | ||
// 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. | ||
isISO31661Alpha3(str: string): boolean; | ||
export interface IsFloatOptions { | ||
/** | ||
* less or equal | ||
*/ | ||
min?: number; | ||
/** | ||
* greater or equal | ||
*/ | ||
max?: number; | ||
/** | ||
* greater than | ||
*/ | ||
gt?: number; | ||
/** | ||
* less than | ||
*/ | ||
lt?: number; | ||
/** | ||
* FloatLocale | ||
*/ | ||
locale?: FloatLocale; | ||
} | ||
// check if the string is a ISRC (https://en.wikipedia.org/wiki/International_Standard_Recording_Code). | ||
isISRC(str: string): boolean; | ||
/** | ||
* Check if the string is a float. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isFloat(str: string, options?: IsFloatOptions): boolean; | ||
// check if the string is in a array of allowed values. | ||
isIn(str: string, values: any[]): boolean; | ||
export interface IsFQDNOptions { | ||
/** | ||
* @default true | ||
*/ | ||
require_tld?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_underscores?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_trailing_dot?: boolean; | ||
} | ||
// check if the string is an integer. | ||
isInt(str: string, options?: IsIntOptions): boolean; | ||
/** | ||
* Check if the string is a fully qualified domain name (e.g. `domain.com`). | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isFQDN(str: string, options?: IsFQDNOptions): boolean; | ||
// check if the string is valid JSON (note: uses JSON.parse). | ||
isJSON(str: string): boolean; | ||
/** | ||
* Check if the string contains any full-width chars. | ||
*/ | ||
export function isFullWidth(str: string): boolean; | ||
// check if the string is valid JWT token. | ||
isJWT(str: string): boolean; | ||
/** | ||
* Check if the string contains any half-width chars. | ||
*/ | ||
export function isHalfWidth(str: string): boolean; | ||
// check if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long. | ||
isLatLong(str: string): boolean; | ||
export type HashAlgorithm = | ||
| 'md4' | ||
| 'md5' | ||
| 'sha1' | ||
| 'sha256' | ||
| 'sha384' | ||
| 'sha512' | ||
| 'ripemd128' | ||
| 'ripemd160' | ||
| 'tiger128' | ||
| 'tiger160' | ||
| 'tiger192' | ||
| 'crc32' | ||
| 'crc32b'; | ||
// check if the string's length falls in a range. | ||
// Note: this function takes into account surrogate pairs. | ||
isLength(str: string, options: IsLengthOptions): boolean; | ||
isLength(str: string, min: number, max?: number): boolean; | ||
/** | ||
* Check if the string is a hash of type algorithm. | ||
* | ||
* @param algorithm - HashAlgorithm | ||
*/ | ||
export function isHash(str: string, algorithm: HashAlgorithm): boolean; | ||
// check if the string is lowercase. | ||
isLowercase(str: string): boolean; | ||
/** | ||
* Check if the string is a hexadecimal number. | ||
*/ | ||
export function isHexadecimal(str: string): boolean; | ||
// check if the string is a MAC address. | ||
isMACAddress(str: string): boolean; | ||
/** | ||
* Check if the string is a hexadecimal color. | ||
*/ | ||
export function isHexColor(str: string): boolean; | ||
// check if the string is a MD5 hash. | ||
isMD5(str: string): boolean; | ||
export type IdentityCardLocale = 'ES' | 'he-IL' | 'zh-TW'; | ||
// check if the string matches to a valid MIME type (https://en.wikipedia.org/wiki/Media_type) format | ||
isMimeType(str: string): boolean; | ||
/** | ||
* Check if the string is a valid identity card code. | ||
* | ||
* @param [locale="any"] - IdentityCardLocale | ||
*/ | ||
export function isIdentityCard(str: string, locale?: 'any' | IdentityCardLocale): boolean; | ||
// check if the string is a mobile phone number, (locale is either an array of locales or one of | ||
// ['ar-AE', ar-DZ', 'ar-EG', 'ar-JO', 'ar-SA', 'ar-SY', 'be-BY', 'bg-BG', 'cs-CZ', 'de-DE', | ||
// 'da-DK', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-KE', 'en-NG', 'en-NZ', 'en-UG', | ||
// 'en-RW', 'en-SG', 'en-TZ', 'en-PK', 'en-US', 'en-CA', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', | ||
// 'fi-FI', 'fo-FO', 'fr-FR', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'ja-JP', 'kk-KZ', 'kl-GL', | ||
// 'ko-KR', 'lt-LT', 'ms-MY', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', | ||
// 'sr-RS', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-TW'] or defaults to 'any'). | ||
isMobilePhone(str: string, locale?: MobilePhoneLocale | MobilePhoneLocale[], options?: IsMobilePhoneOptions): boolean; | ||
/** | ||
* Check if the string is in a array of allowed values. | ||
* | ||
* @param values - Allowed values. | ||
*/ | ||
export function isIn(str: string, values: any[]): boolean; | ||
// check if the string is a valid hex-encoded representation of a MongoDB ObjectId | ||
// (http://docs.mongodb.org/manual/reference/object-id/). | ||
isMongoId(str: string): boolean; | ||
export interface IsIntOptions { | ||
/** | ||
* to check the integer min boundary | ||
*/ | ||
min?: number; | ||
/** | ||
* to check the integer max boundary | ||
*/ | ||
max?: number; | ||
/** | ||
* if `false`, will disallow integer values with leading zeroes | ||
* @default true | ||
*/ | ||
allow_leading_zeroes?: boolean; | ||
/** | ||
* enforce integers being greater than the value provided | ||
*/ | ||
lt?: number; | ||
/** | ||
* enforce integers being less than the value provided | ||
*/ | ||
gt?: number; | ||
} | ||
// check if the string contains one or more multibyte chars. | ||
isMultibyte(str: string): boolean; | ||
/** | ||
* Check if the string is an integer. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isInt(str: string, options?: IsIntOptions): boolean; | ||
// check if the string contains only numbers. | ||
isNumeric(str: string, options?: IsNumericOptions): boolean; | ||
/** | ||
* Check if the string is an IP (version 4 or 6). | ||
* | ||
* @param [version] - IP Version | ||
*/ | ||
export function isIP(str: string, version?: '4' | '6'): boolean; | ||
// check if the string is a valid port number. | ||
isPort(str: string): boolean; | ||
/** | ||
* Check if the string is an IP Range (version 4 only). | ||
*/ | ||
export function isIPRange(str: string): boolean; | ||
// check if the string is a postal code, (locale is one of | ||
// [ 'AT', 'AU', 'BE', 'BG', 'CA', 'CH', 'CZ', 'DE', 'DK', 'DZ', 'ES', 'FI', 'FR', 'GB', 'GR', | ||
// 'IL', 'IN', 'IS', 'IT', 'JP', 'KE', 'LI', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'RU', 'SA', | ||
// 'SE', 'TW', 'US', 'ZA', 'ZM' ]) OR 'any'. If 'any' is used, function will check if any of the | ||
// locales match). | ||
isPostalCode(str: string, locale: PostalCodeLocale): boolean; | ||
/** | ||
* Check if the string is an ISBN (version 10 or 13). | ||
* | ||
* @param [version] - ISBN Version | ||
*/ | ||
export function isISBN(str: string, version?: '10' | '13'): boolean; | ||
// check if the string contains any surrogate pairs chars. | ||
isSurrogatePair(str: string): boolean; | ||
/** | ||
* Check if the string is an [ISIN](https://en.wikipedia.org/wiki/International_Securities_Identification_Number) (stock/security identifier). | ||
*/ | ||
export function isISIN(str: string): boolean; | ||
// check if the string is an URL. | ||
isURL(str: string, options?: IsURLOptions): 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. | ||
*/ | ||
export function isISO31661Alpha2(str: string): boolean; | ||
// check if the string is a UUID. Must be one of ['3', '4', '5', 'all'], default is all. | ||
isUUID(str: string, version?: 3|4|5|"3"|"4"|"5"|"all"): 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. | ||
*/ | ||
export function isISO31661Alpha3(str: string): boolean; | ||
// check if the string is uppercase. | ||
isUppercase(str: string): boolean; | ||
export interface IsISO8601Options { | ||
/** | ||
* If `strict` is `true`, performs additional checks for valid dates, | ||
* e.g. invalidates dates like `2009-02-29`. | ||
* | ||
* @default false | ||
*/ | ||
strict?: boolean; | ||
} | ||
// check if the string contains a mixture of full and half-width chars. | ||
isVariableWidth(str: string): boolean; | ||
/** | ||
* Check if the string is a valid [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isISO8601(str: string, options?: IsISO8601Options): boolean; | ||
// checks characters if they appear in the whitelist. | ||
isWhitelisted(str: string, chars: string | string[]): boolean; | ||
export interface IsISSNOptions { | ||
/** | ||
* If `case_sensitive` is `true`, ISSNs with a lowercase `x` as the check digit are rejected. | ||
* | ||
* @default false | ||
*/ | ||
case_sensitive?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
require_hyphen?: boolean; | ||
} | ||
// check if string matches the pattern. | ||
matches(str: string, pattern: RegExp | string, modifiers?: string): boolean; | ||
/** | ||
* Check if the string is an [ISSN](https://en.wikipedia.org/wiki/International_Standard_Serial_Number). | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isISSN(str: string, options?: IsISSNOptions): boolean; | ||
// ************** | ||
// * Sanitizers * | ||
// ************** | ||
/** | ||
* Check if the string is a [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code). | ||
*/ | ||
export function isISRC(str: string): boolean; | ||
// remove characters that appear in the blacklist. The characters are used in a RegExp and so you will need | ||
// to escape some chars, e.g. blacklist(input, '\\[\\]'). | ||
blacklist(input: string, chars: string): string; | ||
/** | ||
* Check if the string is a valid [RFC 3339](https://tools.ietf.org/html/rfc3339) date. | ||
*/ | ||
export function isRFC3339(str: string): boolean; | ||
// replace <, >, &, ', " and / with HTML entities. | ||
escape(input: string): string; | ||
/** | ||
* Check if the string is valid JSON (note: uses `JSON.parse`). | ||
*/ | ||
export function isJSON(str: string): boolean; | ||
// replaces HTML encoded entities with <, >, &, ', " and /. | ||
unescape(input: string): string; | ||
/** | ||
* Check if the string is valid JWT token. | ||
*/ | ||
export function isJWT(str: string): boolean; | ||
// trim characters from the left-side of the input. | ||
ltrim(input: string, chars?: string): string; | ||
/** | ||
* Check if the string is a valid latitude-longitude coordinate in the format: | ||
* | ||
* `lat,long` or `lat, long`. | ||
*/ | ||
export function isLatLong(str: string): boolean; | ||
// canonicalize an email address. | ||
normalizeEmail(email: string, options?: NormalizeEmailOptions): string | false; | ||
export interface IsLengthOptions { | ||
/** | ||
* @default 0 | ||
*/ | ||
min?: number; | ||
/** | ||
* @default undefined | ||
*/ | ||
max?: number; | ||
} | ||
// trim characters from the right-side of the input. | ||
rtrim(input: string, chars?: string): string; | ||
/** | ||
* Check if the string's length falls in a range. | ||
* | ||
* Note: this function takes into account surrogate pairs. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isLength(str: string, options?: IsLengthOptions): boolean; | ||
// remove characters with a numerical value < 32 and 127, mostly control characters. If keep_new_lines is true, | ||
// newline characters are preserved (\n and \r, hex 0xA and 0xD). Unicode-safe in JavaScript. | ||
stripLow(input: string, keep_new_lines?: boolean): string; | ||
/** | ||
* Check if the string is lowercase. | ||
*/ | ||
export function isLowercase(str: string): boolean; | ||
// convert the input to a boolean. Everything except for '0', 'false' and '' returns true. In strict mode only '1' | ||
// and 'true' return true. | ||
toBoolean(input: string, strict?: boolean): boolean; | ||
export interface IsMACAddressOptions { | ||
/** | ||
* 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`. | ||
* | ||
* @default false | ||
*/ | ||
no_colons?: boolean; | ||
} | ||
// convert the input to a date, or null if the input is not a date. | ||
toDate(input: string): Date; // Date or null | ||
/** | ||
* Check if the string is a MAC address. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isMACAddress(str: string, options?: IsMACAddressOptions): boolean; | ||
// convert the input to a float, or NaN if the input is not a float. | ||
toFloat(input: string): number; // number or NaN | ||
/** | ||
* Check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme). | ||
*/ | ||
export function isMagnetURI(str: string): boolean; | ||
// convert the input to an integer, or NaN if the input is not an integer. | ||
toInt(input: string, radix?: number): number; // number or NaN | ||
/** | ||
* Check if the string is a MD5 hash. | ||
*/ | ||
export function isMD5(str: string): boolean; | ||
// trim characters (whitespace by default) from both sides of the input. | ||
trim(input: string, chars?: string): string; | ||
/** | ||
* Check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format. | ||
*/ | ||
export function isMimeType(str: string): boolean; | ||
// remove characters that do not appear in the whitelist. The characters are used in a RegExp and so you will | ||
// need to escape some chars, e.g. whitelist(input, '\\[\\]'). | ||
whitelist(input: string, chars: string): string; | ||
export 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'; | ||
toString(input: any | any[]): string; | ||
export const isMobilePhoneLocales: MobilePhoneLocale[]; | ||
version: string; | ||
export interface IsMobilePhoneOptions { | ||
/** | ||
* If this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. | ||
* | ||
* @default false | ||
*/ | ||
strictMode?: boolean; | ||
} | ||
// ************** | ||
// * Extensions * | ||
// ************** | ||
/** | ||
* Check if the string is a mobile phone number. | ||
* | ||
* @param [locale] - MobilePhoneLocale(s) | ||
* @param [options] - Options | ||
*/ | ||
export function isMobilePhone( | ||
str: string, | ||
locale?: 'any' | MobilePhoneLocale | MobilePhoneLocale[], | ||
options?: IsMobilePhoneOptions, | ||
): boolean; | ||
// add your own validators. | ||
// Note: that the first argument will be automatically coerced to a string. | ||
extend<T extends Function>(name: string, fn: T): void; | ||
} | ||
/** | ||
* Check if the string is a valid hex-encoded representation of a [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/). | ||
*/ | ||
export function isMongoId(str: string): boolean; | ||
// options for IsByteLength | ||
interface IsByteLengthOptions { | ||
min?: number; | ||
max?: number; | ||
} | ||
/** | ||
* Check if the string contains one or more multibyte chars. | ||
*/ | ||
export function isMultibyte(str: string): boolean; | ||
// options for IsCurrency | ||
interface IsCurrencyOptions { | ||
symbol?: string; | ||
require_symbol?: boolean; | ||
allow_space_after_symbol?: boolean; | ||
symbol_after_digits?: boolean; | ||
allow_negatives?: boolean; | ||
parens_for_negatives?: boolean; | ||
negative_sign_before_digits?: boolean; | ||
negative_sign_after_digits?: boolean; | ||
allow_negative_sign_placeholder?: boolean; | ||
thousands_separator?: string; | ||
decimal_separator?: string; | ||
allow_decimal?: boolean; | ||
require_decimal?: boolean; | ||
digits_after_decimal?: number[]; | ||
allow_space_after_digits?: boolean; | ||
} | ||
export interface IsNumericOptions { | ||
/** | ||
* If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`). | ||
* | ||
* @default false | ||
*/ | ||
no_symbols?: boolean; | ||
} | ||
// options for isDecimal | ||
interface IsDecimalOptions { | ||
force_decimal?: boolean; | ||
decimal_digits?: string; | ||
locale?: DecimalLocale; | ||
} | ||
/** | ||
* Check if the string contains only numbers. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isNumeric(str: string, options?: IsNumericOptions): boolean; | ||
// options for isEmail | ||
interface IsEmailOptions { | ||
allow_display_name?: boolean; | ||
require_display_name?: boolean; | ||
allow_utf8_local_part?: boolean; | ||
require_tld?: boolean; | ||
} | ||
/** | ||
* Check if the string is a valid octal number. | ||
*/ | ||
export function isOctal(str: string): boolean; | ||
// options for isEmpty | ||
interface IsEmptyOptions { | ||
ignore_whitespace?: boolean; | ||
} | ||
/** | ||
* Check if the string is a valid port number. | ||
*/ | ||
export function isPort(str: string): boolean; | ||
// options for isFQDN | ||
interface IsFQDNOptions { | ||
require_tld?: boolean; | ||
allow_underscores?: boolean; | ||
allow_trailing_dot?: boolean; | ||
} | ||
export 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'; | ||
// options for IsFloat | ||
interface IsFloatOptions { | ||
min?: number; | ||
max?: number; | ||
gt?: number; | ||
lt?: number; | ||
locale?: FloatLocale; | ||
} | ||
export const isPostalCodeLocales: PostalCodeLocale[]; | ||
// options for isISSN | ||
interface IsISSNOptions { | ||
case_sensitive?: boolean; | ||
require_hyphen?: boolean; | ||
} | ||
/** | ||
* Check if the string is a postal code | ||
* | ||
* @param locale - PostalCodeLocale | ||
*/ | ||
export function isPostalCode(str: string, locale: 'any' | PostalCodeLocale): boolean; | ||
// options for IsInt | ||
interface IsIntOptions { | ||
min?: number; | ||
max?: number; | ||
allow_leading_zeroes?: boolean; | ||
lt?: number; | ||
gt?: number; | ||
} | ||
/** | ||
* Check if the string contains any surrogate pairs chars. | ||
*/ | ||
export function isSurrogatePair(str: string): boolean; | ||
// options for isISO8601 | ||
interface IsISO8601Options { | ||
strict?: boolean; | ||
} | ||
// options for IsLength | ||
interface IsLengthOptions { | ||
min?: number; | ||
max?: number; | ||
} | ||
// options for isMobilePhone | ||
interface IsMobilePhoneOptions { | ||
strictMode?: boolean; | ||
} | ||
// options for isURL | ||
interface IsURLOptions { | ||
export interface IsURLOptions { | ||
/** | ||
* @default ['http','https','ftp'] | ||
*/ | ||
protocols?: string[]; | ||
/** | ||
* @default true | ||
*/ | ||
require_tld?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
require_protocol?: boolean; | ||
/** | ||
* @default true | ||
*/ | ||
require_host?: boolean; | ||
/** | ||
* @default true | ||
*/ | ||
require_valid_protocol?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_underscores?: boolean; | ||
host_whitelist?: (string | RegExp)[]; | ||
host_blacklist?: (string | RegExp)[]; | ||
/** | ||
* @default false | ||
*/ | ||
host_whitelist?: Array<string | RegExp>; | ||
/** | ||
* @default false | ||
*/ | ||
host_blacklist?: Array<string | RegExp>; | ||
/** | ||
* @default false | ||
*/ | ||
allow_trailing_dot?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
allow_protocol_relative_urls?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
disallow_auth?: boolean; | ||
} | ||
} | ||
// options for normalizeEmail | ||
interface NormalizeEmailOptions { | ||
/** | ||
* Check if the string is an URL. | ||
* | ||
* @param [options] - Options | ||
*/ | ||
export function isURL(str: string, options?: IsURLOptions): boolean; | ||
/** | ||
* Check if the string is uppercase. | ||
*/ | ||
export function isUppercase(str: string): boolean; | ||
/** | ||
* Check if the string is a UUID (version 3, 4 or 5). | ||
* | ||
* @param [version="all"] - UUID version | ||
*/ | ||
export function isUUID(str: string, version?: 3 | 4 | 5 | '3' | '4' | '5' | 'all'): boolean; | ||
/** | ||
* Check if the string contains a mixture of full and half-width chars. | ||
*/ | ||
export function isVariableWidth(str: string): boolean; | ||
/** | ||
* Checks characters if they appear in the whitelist. | ||
* | ||
* @param chars - whitelist | ||
*/ | ||
export function isWhitelisted(str: string, chars: string | string[]): boolean; | ||
/** | ||
* Check if string matches the pattern. | ||
* | ||
* @param pattern - `/foo/i` | ||
*/ | ||
export function matches(str: string, pattern: RegExp): boolean; | ||
/** | ||
* Check if string matches the pattern. | ||
* | ||
* @param pattern - `'foo'` | ||
* @param [modifiers] - `'i'` | ||
*/ | ||
export function matches(str: string, pattern: string, modifiers?: string): boolean; | ||
/** | ||
* Check if the string is of type slug. | ||
*/ | ||
export function isSlug(str: string): boolean; | ||
/****************** | ||
*** Sanitizers *** | ||
******************/ | ||
/** | ||
* Remove characters that appear in the blacklist. | ||
* | ||
* @param chars - The characters are used in a `RegExp` and so you will need to escape some chars, e.g. `blacklist(input, '\\[\\]')`. | ||
*/ | ||
export function blacklist(input: string, chars: string): string; | ||
/** | ||
* Replace `<`, `>`, `&`, `'`, `"` and `/` with HTML entities. | ||
*/ | ||
export function escape(input: string): string; | ||
/** | ||
* Replaces HTML encoded entities with `<`, `>`, `&`, `'`, `"` and `/`. | ||
*/ | ||
export function unescape(input: string): string; | ||
/** | ||
* Trim characters from the left-side of the input. | ||
* | ||
* @param [chars] - characters (defaults to whitespace) | ||
*/ | ||
export function ltrim(input: string, chars?: string): string; | ||
export interface NormalizeEmailOptions { | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
all_lowercase?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
gmail_lowercase?: boolean; | ||
/** | ||
* Removes dots from the local part of the email address, as GMail ignores them | ||
* (e.g. `"john.doe"` and `"johndoe"` are considered equal). | ||
* | ||
* @default true | ||
*/ | ||
gmail_remove_dots?: boolean; | ||
/** | ||
* Normalizes addresses by removing "sub-addresses", which is the part following a `"+"` sign | ||
* (e.g. `"foo+bar@gmail.com"` becomes `"foo@gmail.com"`). | ||
* | ||
* @default true | ||
*/ | ||
gmail_remove_subaddress?: boolean; | ||
/** | ||
* Converts addresses with domain `@googlemail.com` to `@gmail.com`, as they're equivalent. | ||
* | ||
* @default true | ||
*/ | ||
gmail_convert_googlemaildotcom?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
outlookdotcom_lowercase?: boolean; | ||
/** | ||
* Normalizes addresses by removing "sub-addresses", which is the part following a `"+"` sign | ||
* (e.g. `"foo+bar@outlook.com"` becomes `"foo@outlook.com"`). | ||
* | ||
* @default true | ||
*/ | ||
outlookdotcom_remove_subaddress?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
yahoo_lowercase?: boolean; | ||
/** | ||
* Normalizes addresses by removing "sub-addresses", which is the part following a `"-"` sign | ||
* (e.g. `"foo-bar@yahoo.com"` becomes `"foo@yahoo.com"`). | ||
* | ||
* @default true | ||
*/ | ||
yahoo_remove_subaddress?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
icloud_lowercase?: boolean; | ||
/** | ||
* Normalizes addresses by removing "sub-addresses", which is the part following a `"+"` sign | ||
* (e.g. `"foo+bar@icloud.com"` becomes `"foo@icloud.com"`). | ||
* | ||
* @default true | ||
*/ | ||
icloud_remove_subaddress?: boolean; | ||
} | ||
/** | ||
* Options for isNumeric | ||
*/ | ||
interface IsNumericOptions { | ||
no_symbols?: boolean; | ||
} | ||
} | ||
/** | ||
* MODULES | ||
* Canonicalizes an email address. (This doesn't validate that the input is an email, if you want to validate the email use `isEmail` beforehand) | ||
* | ||
* @param [options] - Options | ||
*/ | ||
declare var validator: ValidatorJS.ValidatorStatic; | ||
export function normalizeEmail(email: string, options?: NormalizeEmailOptions): string | false; | ||
declare module "validator" { | ||
export = validator; | ||
} | ||
/** | ||
* Trim characters from the right-side of the input. | ||
* | ||
* @param [chars] - characters (defaults to whitespace) | ||
*/ | ||
export function rtrim(input: string, chars?: string): string; | ||
// deprecated interfaces for backward compatibility, please use ValidatorJS.* instead the ones | ||
interface IValidatorStatic extends ValidatorJS.ValidatorStatic { } | ||
interface IURLoptions extends ValidatorJS.IsURLOptions { } | ||
interface IFQDNoptions extends ValidatorJS.IsFQDNOptions { } | ||
interface IEmailoptions extends ValidatorJS.NormalizeEmailOptions { } | ||
/** | ||
* Remove characters with a numerical value < `32` and `127`, mostly control characters. | ||
* Unicode-safe in JavaScript. | ||
* | ||
* @param [keep_new_lines=false] - if `true`, newline characters are preserved (`\n` and `\r`, hex `0xA` and `0xD`). | ||
*/ | ||
export function stripLow(input: string, keep_new_lines?: boolean): string; | ||
/** | ||
* Convert the input string to a boolean. | ||
* Everything except for `'0'`, `'false'` and `''` returns `true`. | ||
* | ||
* @param [strict=false] - in `strict` mode, only `'1'` and `'true'` return `true`. | ||
*/ | ||
export function toBoolean(input: string, strict?: boolean): boolean; | ||
/** | ||
* Convert the input string to a `Date`, or `null` if the input is not a date. | ||
*/ | ||
export function toDate(input: string): Date | null; | ||
/** | ||
* Convert the input string to a float, or `NaN` if the input is not a float. | ||
*/ | ||
export function toFloat(input: string): number; | ||
/** | ||
* Convert the input string to an integer, or `NaN` if the input is not an integer. | ||
* | ||
* @param [radix=10] - radix or base (defaults to 10) | ||
*/ | ||
export function toInt(input: string, radix?: number): number; | ||
/** | ||
* Trim characters from both sides of the input. | ||
* | ||
* @param [chars] - characters (defaults to whitespace) | ||
*/ | ||
export function trim(input: string, chars?: string): string; | ||
/** | ||
* Remove characters that do not appear in the whitelist. | ||
* | ||
* @param chars - The characters are used in a `RegExp` and so you will need to escape some chars, e.g. `whitelist(input, '\\[\\]')`. | ||
*/ | ||
export function whitelist(input: string, chars: string): string; | ||
/** | ||
* Converts to string. | ||
*/ | ||
export function toString(input: any): string; | ||
import * as Validator from './'; | ||
export default Validator; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const blacklist: typeof validator.blacklist; | ||
export = blacklist; | ||
export { blacklist as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const contains: typeof validator.contains; | ||
export = contains; | ||
export { contains as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const equals: typeof validator.equals; | ||
export = equals; | ||
export { equals as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const escape: typeof validator.escape; | ||
export = escape; | ||
export { escape as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isAfter: typeof validator.isAfter; | ||
export = isAfter; | ||
export { isAfter as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isAlpha: typeof validator.isAlpha; | ||
export = isAlpha; | ||
export { isAlpha as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isAlphanumeric: typeof validator.isAlphanumeric; | ||
export = isAlphanumeric; | ||
export { isAlphanumeric as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isAscii: typeof validator.isAscii; | ||
export = isAscii; | ||
export { isAscii as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isBase64: typeof validator.isBase64; | ||
export = isBase64; | ||
export { isBase64 as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isBefore: typeof validator.isBefore; | ||
export = isBefore; | ||
export { isBefore as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isBoolean: typeof validator.isBoolean; | ||
export = isBoolean; | ||
export { isBoolean as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isByteLength: typeof validator.isByteLength; | ||
export = isByteLength; | ||
export { isByteLength as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isCreditCard: typeof validator.isCreditCard; | ||
export = isCreditCard; | ||
export { isCreditCard as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isCurrency: typeof validator.isCurrency; | ||
export = isCurrency; | ||
export { isCurrency as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isDataURI: typeof validator.isDataURI; | ||
export = isDataURI; | ||
export { isDataURI as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isDecimal: typeof validator.isDecimal; | ||
export = isDecimal; | ||
export { isDecimal as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isDivisibleBy: typeof validator.isDivisibleBy; | ||
export = isDivisibleBy; | ||
export { isDivisibleBy as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isEmail: typeof validator.isEmail; | ||
export = isEmail; | ||
export { isEmail as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isEmpty: typeof validator.isEmpty; | ||
export = isEmpty; | ||
export { isEmpty as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isFloat: typeof validator.isFloat; | ||
export = isFloat; | ||
export { isFloat as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isFQDN: typeof validator.isFQDN; | ||
export = isFQDN; | ||
export { isFQDN as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isFullWidth: typeof validator.isFullWidth; | ||
export = isFullWidth; | ||
export { isFullWidth as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isHalfWidth: typeof validator.isHalfWidth; | ||
export = isHalfWidth; | ||
export { isHalfWidth as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isHash: typeof validator.isHash; | ||
export = isHash; | ||
export { isHash as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isHexadecimal: typeof validator.isHexadecimal; | ||
export = isHexadecimal; | ||
export { isHexadecimal as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isHexColor: typeof validator.isHexColor; | ||
export = isHexColor; | ||
export { isHexColor as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isIn: typeof validator.isIn; | ||
export = isIn; | ||
export { isIn as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isInt: typeof validator.isInt; | ||
export = isInt; | ||
export { isInt as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isIP: typeof validator.isIP; | ||
export = isIP; | ||
export { isIP as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISBN: typeof validator.isISBN; | ||
export = isISBN; | ||
export { isISBN as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISIN: typeof validator.isISIN; | ||
export = isISIN; | ||
export { isISIN as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISO31661Alpha2: typeof validator.isISO31661Alpha2; | ||
export = isISO31661Alpha2; | ||
export { isISO31661Alpha2 as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISO31661Alpha3: typeof validator.isISO31661Alpha3; | ||
export = isISO31661Alpha3; | ||
export { isISO31661Alpha3 as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISO8601: typeof validator.isISO8601; | ||
export = isISO8601; | ||
export { isISO8601 as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISRC: typeof validator.isISRC; | ||
export = isISRC; | ||
export { isISRC as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isISSN: typeof validator.isISSN; | ||
export = isISSN; | ||
export { isISSN as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isJSON: typeof validator.isJSON; | ||
export = isJSON; | ||
export { isJSON as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isJWT: typeof validator.isJWT; | ||
export = isJWT; | ||
export { isJWT as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isLatLong: typeof validator.isLatLong; | ||
export = isLatLong; | ||
export { isLatLong as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isLength: typeof validator.isLength; | ||
export = isLength; | ||
export { isLength as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isLowercase: typeof validator.isLowercase; | ||
export = isLowercase; | ||
export { isLowercase as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMACAddress: typeof validator.isMACAddress; | ||
export = isMACAddress; | ||
export { isMACAddress as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMD5: typeof validator.isMD5; | ||
export = isMD5; | ||
export { isMD5 as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMimeType: typeof validator.isMimeType; | ||
export = isMimeType; | ||
export { isMimeType as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMobilePhone: typeof validator.isMobilePhone; | ||
export = isMobilePhone; | ||
export { isMobilePhone as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMongoId: typeof validator.isMongoId; | ||
export = isMongoId; | ||
export { isMongoId as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isMultibyte: typeof validator.isMultibyte; | ||
export = isMultibyte; | ||
export { isMultibyte as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isNumeric: typeof validator.isNumeric; | ||
export = isNumeric; | ||
export { isNumeric as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isPort: typeof validator.isPort; | ||
export = isPort; | ||
export { isPort as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isPostalCode: typeof validator.isPostalCode; | ||
export = isPostalCode; | ||
export { isPostalCode as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isSurrogatePair: typeof validator.isSurrogatePair; | ||
export = isSurrogatePair; | ||
export { isSurrogatePair as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isUppercase: typeof validator.isUppercase; | ||
export = isUppercase; | ||
export { isUppercase as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isURL: typeof validator.isURL; | ||
export = isURL; | ||
export { isURL as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isUUID: typeof validator.isUUID; | ||
export = isUUID; | ||
export { isUUID as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isVariableWidth: typeof validator.isVariableWidth; | ||
export = isVariableWidth; | ||
export { isVariableWidth as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const isWhitelisted: typeof validator.isWhitelisted; | ||
export = isWhitelisted; | ||
export { isWhitelisted as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const ltrim: typeof validator.ltrim; | ||
export = ltrim; | ||
export { ltrim as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const matches: typeof validator.matches; | ||
export = matches; | ||
export { matches as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const normalizeEmail: typeof validator.normalizeEmail; | ||
export = normalizeEmail; | ||
export { normalizeEmail as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const rtrim: typeof validator.rtrim; | ||
export = rtrim; | ||
export { rtrim as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const stripLow: typeof validator.stripLow; | ||
export = stripLow; | ||
export { stripLow as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const toBoolean: typeof validator.toBoolean; | ||
export = toBoolean; | ||
export { toBoolean as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const toDate: typeof validator.toDate; | ||
export = toDate; | ||
export { toDate as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const toFloat: typeof validator.toFloat; | ||
export = toFloat; | ||
export { toFloat as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const toInt: typeof validator.toInt; | ||
export = toInt; | ||
export { toInt as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const trim: typeof validator.trim; | ||
export = trim; | ||
export { trim as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const unescape: typeof validator.unescape; | ||
export = unescape; | ||
export { unescape as default } from '../'; |
@@ -1,3 +0,1 @@ | ||
import * as validator from "validator"; | ||
declare const whitelist: typeof validator.whitelist; | ||
export = whitelist; | ||
export { whitelist as default } from '../'; |
{ | ||
"name": "@types/validator", | ||
"version": "10.11.3", | ||
"version": "12.0.0", | ||
"description": "TypeScript definitions for validator.js", | ||
@@ -51,6 +51,11 @@ "license": "MIT", | ||
"githubUsername": "keatz55" | ||
}, | ||
{ | ||
"name": "Munif Tanjim", | ||
"url": "https://github.com/MunifTanjim", | ||
"githubUsername": "MunifTanjim" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -63,4 +68,4 @@ "type": "git", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "32d9507af3829a8601aa72c9c1e9471b3c8cf45d30c1fe42146bcb836ad17fc9", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "0cc6239c47020475e5d0091cacbe72bd1014ec76e6a4b8811e64ae0e62188beb", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -5,13 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for validator.js (https://github.com/chriso/validator.js). | ||
This package contains type definitions for validator.js (https://github.com/validatorjs/validator.js). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validator | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validator. | ||
Additional Details | ||
* Last updated: Mon, 19 Aug 2019 17:42:03 GMT | ||
### Additional Details | ||
* Last updated: Mon, 18 Nov 2019 20:48:16 GMT | ||
* Dependencies: none | ||
* Global values: validator | ||
* Global values: none | ||
# Credits | ||
These definitions were written by tgfjt <https://github.com/tgfjt>, Ilya Mochalov <https://github.com/chrootsu>, Ayman Nedjmeddine <https://github.com/IOAyman>, Louy Alakkad <https://github.com/louy>, Kacper Polak <https://github.com/kacepe>, Bonggyun Lee <https://github.com/deptno>, Naoto Yokoyama <https://github.com/builtinnya>, Philipp Katz <https://github.com/qqilihq>, and Jace Warren <https://github.com/keatz55>. | ||
These definitions were written by tgfjt (https://github.com/tgfjt), Ilya Mochalov (https://github.com/chrootsu), Ayman Nedjmeddine (https://github.com/IOAyman), Louy Alakkad (https://github.com/louy), Kacper Polak (https://github.com/kacepe), Bonggyun Lee (https://github.com/deptno), Naoto Yokoyama (https://github.com/builtinnya), Philipp Katz (https://github.com/qqilihq), Jace Warren (https://github.com/keatz55), and Munif Tanjim (https://github.com/MunifTanjim). |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
36060
80
1214
1