async-validator
Advanced tools
Comparing version 4.0.9 to 4.1.0
@@ -1201,3 +1201,7 @@ 'use strict'; | ||
} else if (rule.validator) { | ||
res = rule.validator(rule, data.value, cb, data.source, options); | ||
try { | ||
res = rule.validator(rule, data.value, cb, data.source, options); | ||
} catch (error) { | ||
cb(error.message); | ||
} | ||
@@ -1204,0 +1208,0 @@ if (res === true) { |
@@ -1197,3 +1197,7 @@ function _extends() { | ||
} else if (rule.validator) { | ||
res = rule.validator(rule, data.value, cb, data.source, options); | ||
try { | ||
res = rule.validator(rule, data.value, cb, data.source, options); | ||
} catch (error) { | ||
cb(error.message); | ||
} | ||
@@ -1200,0 +1204,0 @@ if (res === true) { |
{ | ||
"name": "async-validator", | ||
"description": "validate form asynchronous", | ||
"version": "4.0.9", | ||
"version": "4.1.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -85,7 +85,7 @@ # async-validator | ||
* `options`: An object describing processing options for the validation (optional). | ||
* `callback`: A callback function to invoke when validation completes (required). | ||
* `callback`: A callback function to invoke when validation completes (optional). | ||
The method will return a Promise object like: | ||
* `then()`,validation passed | ||
* `catch({ errors, fields })`,validation failed, errors is an array of all errors, fields is an object keyed by field name with an array of | ||
* `catch({ errors, fields })`,validation failed, errors is an array of all errors, fields is an object keyed by field name with an array of errors per field | ||
@@ -92,0 +92,0 @@ ### Options |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
255647
2363