vusion-async-validator
Advanced tools
Comparing version 1.8.7 to 1.8.8
@@ -1,2 +0,12 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
exports["async-validator"] = factory(); | ||
else | ||
root["AsyncValidator"] = factory(); | ||
})(typeof self !== 'undefined' ? self : this, function() { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
@@ -71,3 +81,3 @@ /******/ var installedModules = {}; | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return warning; }); | ||
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export warning */ | ||
/* harmony export (immutable) */ __webpack_exports__["d"] = format; | ||
@@ -94,3 +104,3 @@ /* harmony export (immutable) */ __webpack_exports__["e"] = isEmptyValue; | ||
})) { | ||
// console.warn(type, errors); | ||
console.warn(type, errors); | ||
} | ||
@@ -244,3 +254,3 @@ } | ||
return function (oe) { | ||
if (oe && oe.message) { | ||
if (oe && (typeof oe === 'undefined' ? 'undefined' : _typeof(oe)) === 'object') { | ||
oe.field = oe.field || rule.fullField; | ||
@@ -250,3 +260,3 @@ return oe; | ||
return { | ||
message: oe, | ||
message: typeof oe === 'string' ? oe : undefined, | ||
field: oe.field || rule.fullField | ||
@@ -504,3 +514,5 @@ }; | ||
if (errors.length) { | ||
Object(__WEBPACK_IMPORTED_MODULE_0__util__["f" /* warning */])('async-validator:', errors); | ||
errors = errors.map(function (error) { | ||
return true; | ||
}); | ||
} | ||
@@ -1612,2 +1624,3 @@ if (errors.length && rule.message) { | ||
default: 'Validation error on field %s', | ||
required: '%s is required', | ||
enum: '%s must be one of %s', | ||
@@ -1667,2 +1680,3 @@ whitespace: '%s cannot be empty', | ||
/***/ }) | ||
/******/ ]); | ||
/******/ ]); | ||
}); |
{ | ||
"name": "vusion-async-validator", | ||
"version": "1.8.7", | ||
"version": "1.8.8", | ||
"description": "validate form asynchronous", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -154,3 +154,3 @@ import { format, complementError, asyncMap, warning, deepMerge } from './util'; | ||
if (errors.length) { | ||
warning('async-validator:', errors); | ||
errors = errors.map((error) => true); | ||
} | ||
@@ -157,0 +157,0 @@ if (errors.length && rule.message) { |
export function newMessages() { | ||
return { | ||
default: 'Validation error on field %s', | ||
required: '%s is required', | ||
enum: '%s must be one of %s', | ||
@@ -5,0 +6,0 @@ whitespace: '%s cannot be empty', |
@@ -13,3 +13,3 @@ const formatRegExp = /%[sdj%]/g; | ||
if (errors.every(e => typeof e === 'string')) { | ||
// console.warn(type, errors); | ||
console.warn(type, errors); | ||
} | ||
@@ -163,3 +163,3 @@ } | ||
return (oe) => { | ||
if (oe && oe.message) { | ||
if (oe && typeof oe === 'object') { | ||
oe.field = oe.field || rule.fullField; | ||
@@ -169,4 +169,4 @@ return oe; | ||
return { | ||
message: oe, | ||
field: oe.field || rule.fullField, | ||
message: typeof oe === 'string' ? oe : undefined, | ||
field: oe.field || rule.fullField | ||
}; | ||
@@ -173,0 +173,0 @@ }; |
@@ -6,3 +6,9 @@ var path = require('path'); //加载nodejs的路径处理模块 | ||
path: path.resolve(__dirname, 'dist'), //__dirname是一个nodejs变量,表示当前js文件所在的目录 | ||
filename: 'bundle.js' | ||
filename: 'bundle.js', | ||
library: { | ||
root: 'AsyncValidator', | ||
amd: 'async-validator', | ||
commonjs: 'async-validator', | ||
}, | ||
libraryTarget: 'umd' | ||
}, | ||
@@ -17,2 +23,2 @@ module: { | ||
} | ||
}; | ||
}; |
134518
3750