express-validator
Advanced tools
Comparing version 6.2.0 to 6.3.0
@@ -57,2 +57,3 @@ --- | ||
.custom(checkBlacklistedDomain) | ||
.bail() | ||
// If username is not an email or has a blacklisted domain, checkEmailExists will never run | ||
@@ -145,2 +146,11 @@ .custom(checkEmailExists); | ||
### `.notEmpty()` | ||
> *Returns:* the current validation chain instance | ||
Adds a validator to check if a value is not empty; that is, a string with a length of 1 or bigger. | ||
```js | ||
check('username').notEmpty() | ||
``` | ||
### `.optional(options)` | ||
@@ -147,0 +157,0 @@ - `options` *(optional)*: an object of options to customize the behaviour of optional. |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "6.2.0", | ||
"version": "6.3.0", | ||
"homepage": "https://express-validator.github.io", | ||
@@ -12,0 +12,0 @@ "license": "MIT", |
@@ -21,6 +21,7 @@ import { ReadonlyContext } from './context'; | ||
export declare type ValidationError = { | ||
location?: undefined; | ||
param: '_error'; | ||
msg: any; | ||
nestedErrors: ValidationError[]; | ||
location?: undefined; | ||
value?: undefined; | ||
} | { | ||
@@ -31,2 +32,3 @@ location: Location; | ||
msg: any; | ||
nestedErrors?: unknown[]; | ||
}; | ||
@@ -33,0 +35,0 @@ export interface Request { |
@@ -24,2 +24,3 @@ import { CustomValidator } from '../base'; | ||
isString(): Chain; | ||
notEmpty(options?: Options.IsEmptyOptions): Chain; | ||
private addStandardValidation; | ||
@@ -26,0 +27,0 @@ contains(elem: any): Chain; |
@@ -52,2 +52,6 @@ "use strict"; | ||
} | ||
notEmpty(options) { | ||
this.not(); | ||
return this.isEmpty(options); | ||
} | ||
// Standard validators | ||
@@ -54,0 +58,0 @@ addStandardValidation(validator, ...options) { |
@@ -17,2 +17,3 @@ import { CustomValidator, DynamicMessageCreator } from '../base'; | ||
isString(): Return; | ||
notEmpty(options?: Options.IsEmptyOptions): Return; | ||
contains(elem: any): Return; | ||
@@ -19,0 +20,0 @@ equals(comparison: string): Return; |
@@ -6,3 +6,3 @@ export declare type URLProtocol = 'http' | 'https' | 'ftp'; | ||
export declare 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' | 'fr-BE' | 'hu-HU' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'tr-TR' | 'uk-UA'; | ||
export declare type MobilePhoneLocale = 'any' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-JO' | 'ar-IQ' | 'ar-KW' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'cs-CZ' | 'de-DE' | 'da-DK' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | '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-PY' | 'es-UY' | 'et-EE' | 'fa-IR' | 'fi-FI' | 'fj-FJ' | 'fo-FO' | 'fr-FR' | 'he-IL' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'kk-KZ' | 'kl-GL' | 'lt-LT' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW'; | ||
export declare type MobilePhoneLocale = 'any' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-JO' | 'ar-IQ' | 'ar-KW' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'cs-CZ' | 'de-DE' | 'da-DK' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | '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-PY' | 'es-UY' | 'et-EE' | 'fa-IR' | 'fi-FI' | 'fj-FJ' | 'fo-FO' | 'fr-FR' | 'he-IL' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'kk-KZ' | 'kl-GL' | 'lt-LT' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW'; | ||
export declare type PostalCodeLocale = 'any' | 'AD' | 'AT' | 'AU' | 'BE' | 'BG' | 'BR' | 'CA' | 'CH' | 'CZ' | 'DE' | 'DK' | 'DZ' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HU' | 'ID' | 'IL' | 'IN' | 'IS' | 'IT' | 'JP' | 'KE' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'NL' | 'NO' | 'NZ' | 'PL' | 'PR' | 'PT' | 'RO' | 'RU' | 'SA' | 'SE' | 'SI' | 'TN' | 'TW' | 'UA' | 'US' | 'ZA' | 'ZM'; | ||
@@ -9,0 +9,0 @@ export declare type HashAlgorithm = 'md4' | 'md5' | 'sha1' | 'sha256' | 'sha384' | 'sha512' | 'ripemd128' | 'ripemd160' | 'tiger128' | 'tiger160' | 'tiger192' | 'crc32' | 'crc32b'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116602
90
1851