Socket
Socket
Sign inDemoInstall

async-validator

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-validator - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

11

es/index.js

@@ -168,3 +168,3 @@ import _extends from 'babel-runtime/helpers/extends';

if ((options.first || options.fieldFirst) && errors.length) {
if (options.first && errors.length) {
errorFields[rule.field] = 1;

@@ -217,3 +217,10 @@ return doIt(errors);

rule.validator(rule, data.value, cb, data.source, options);
var res = rule.validator(rule, data.value, cb, data.source, options);
if (res && res.then) {
res.then(function () {
return cb();
}, function (e) {
return cb(e);
});
}
}, function (results) {

@@ -220,0 +227,0 @@ complete(results);

# History
----
## 1.8.0 / 2017-08-16
- validator support return promise.
## 1.7.0 / 2017-06/09

@@ -4,0 +9,0 @@

@@ -186,3 +186,3 @@ 'use strict';

if ((options.first || options.fieldFirst) && errors.length) {
if (options.first && errors.length) {
errorFields[rule.field] = 1;

@@ -235,3 +235,10 @@ return doIt(errors);

rule.validator(rule, data.value, cb, data.source, options);
var res = rule.validator(rule, data.value, cb, data.source, options);
if (res && res.then) {
res.then(function () {
return cb();
}, function (e) {
return cb(e);
});
}
}, function (results) {

@@ -238,0 +245,0 @@ complete(results);

3

package.json
{
"name": "async-validator",
"version": "1.7.1",
"version": "1.8.0",
"description": "validate form asynchronous",

@@ -47,2 +47,3 @@ "keywords": [

"devDependencies": {
"coveralls": "^2.13.1",
"jest": "20.x",

@@ -49,0 +50,0 @@ "pre-commit": "1.x",

@@ -323,3 +323,3 @@ # async-validator

```js
{
const fields = {
asyncField:{

@@ -336,4 +336,13 @@ validator(rule,value,callback){

}
}
}
},
promiseField:{
validator(rule, value){
return ajax({
url:'xx',
value:value
});
}
}
};
```

@@ -340,0 +349,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc