async-validator
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -184,2 +184,5 @@ 'use strict'; | ||
} | ||
if (errors.length) { | ||
(0, _util.warning)('async-validator:', errors); | ||
} | ||
if (errors.length && rule.message) { | ||
@@ -186,0 +189,0 @@ errors = [].concat(rule.message); |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.warning = warning; | ||
exports.format = format; | ||
@@ -14,2 +15,21 @@ exports.isEmptyValue = isEmptyValue; | ||
var warning2 = function warning2() {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
warning2 = function warning2(type, message) { | ||
if (typeof console !== 'undefined' && console.warn) { | ||
console.warn(type, message); | ||
} | ||
}; | ||
} | ||
function warning(type, errors) { | ||
// only warn native warning, default type is string, confuses many people... | ||
if (errors.every(function (e) { | ||
return typeof e === 'string'; | ||
})) { | ||
warning2(type, errors); | ||
} | ||
} | ||
function format() { | ||
@@ -16,0 +36,0 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { |
{ | ||
"name": "async-validator", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "validate form asynchronous", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
55272
1173