express-validator
Advanced tools
Comparing version 6.11.1 to 6.12.0
@@ -68,2 +68,9 @@ --- | ||
You may still use the [`.withMessage()` method](api-validation-chain.md#withmessagemessage) to | ||
override any message obtained from the custom validator with a custom message that is more appropriate | ||
to the route's context. | ||
This is especially useful if you wish to reuse a custom validator function across several routes | ||
throughout the application. | ||
### Field Level | ||
@@ -70,0 +77,0 @@ |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "6.11.1", | ||
"version": "6.12.0", | ||
"homepage": "https://express-validator.github.io", | ||
@@ -55,3 +55,3 @@ "license": "MIT", | ||
"coveralls": "^3.1.0", | ||
"docusaurus": "^1.14.6", | ||
"docusaurus": "^1.14.7", | ||
"eslint": "^7.18.0", | ||
@@ -58,0 +58,0 @@ "eslint-config-prettier": "^7.1.0", |
@@ -33,3 +33,3 @@ import { CustomValidator } from '../base'; | ||
isAlpha(locale?: Options.AlphaLocale, options?: Options.IsAlphaOptions): Chain; | ||
isAlphanumeric(locale?: Options.AlphanumericLocale): Chain; | ||
isAlphanumeric(locale?: Options.AlphanumericLocale, options?: Options.IsAlphanumericOptions): Chain; | ||
isAscii(): Chain; | ||
@@ -36,0 +36,0 @@ isBase32(): Chain; |
@@ -78,4 +78,4 @@ "use strict"; | ||
} | ||
isAlphanumeric(locale) { | ||
return this.addStandardValidation(validator.isAlphanumeric, locale); | ||
isAlphanumeric(locale, options) { | ||
return this.addStandardValidation(validator.isAlphanumeric, locale, options); | ||
} | ||
@@ -82,0 +82,0 @@ isAscii() { |
@@ -25,3 +25,3 @@ import { CustomValidator, DynamicMessageCreator } from '../base'; | ||
isAlpha(locale?: Options.AlphaLocale, options?: Options.IsAlphaOptions): Return; | ||
isAlphanumeric(locale?: Options.AlphanumericLocale): Return; | ||
isAlphanumeric(locale?: Options.AlphanumericLocale, options?: Options.IsAlphanumericOptions): Return; | ||
isAscii(): Return; | ||
@@ -28,0 +28,0 @@ isBase32(): Return; |
@@ -25,3 +25,3 @@ "use strict"; | ||
} | ||
context.addError((err instanceof Error ? err.message : err) || this.message, value, meta); | ||
context.addError(this.message || (err instanceof Error ? err.message : err), value, meta); | ||
} | ||
@@ -28,0 +28,0 @@ } |
@@ -33,2 +33,5 @@ export declare type URLProtocol = 'http' | 'https' | 'ftp' | string; | ||
} | ||
export interface IsAlphanumericOptions { | ||
ignore?: string | RegExp; | ||
} | ||
/** | ||
@@ -35,0 +38,0 @@ * defaults to |
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
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
150731
93
2299
0