Comparing version 0.3.3 to 0.3.4
@@ -20,3 +20,8 @@ // Load modules | ||
if (message) { | ||
var topPath = path.split('.')[0]; | ||
if (message && !this._values.some(function (error) { // Don't add an error when there is already a more specific one | ||
return topPath === error.path.split('.')[0]; | ||
})) { | ||
this._values.push({ | ||
@@ -79,3 +84,4 @@ message: message, | ||
hasTemplate = true; | ||
result[paths[i]] = '{{red}}' + result[paths[i]] + '{{/}}{{br}}' + error.message + '{{/}}'; | ||
var pathMessage = typeof result[paths[i]] === 'object' ? JSON.stringify(result[paths[i]]) : result[paths[i]]; | ||
result[paths[i]] = '{{red}}' + pathMessage + '{{/}}{{br}}' + error.message + '{{/}}'; | ||
} | ||
@@ -82,0 +88,0 @@ |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
@@ -105,3 +105,3 @@ // Load modules | ||
if (unprocessedValueType !== 'function' && unprocessedValueType !== 'undefined') { | ||
errors.add('the key (' + unprocessedKey + ') is not allowed', unprocessedKey); | ||
errors.add('the key (' + unprocessedKey + ') is not allowed', topKeyPath + '.' + unprocessedKey); | ||
result = false; | ||
@@ -108,0 +108,0 @@ } |
{ | ||
"name": "joi", | ||
"description": "Object schema validation", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"author": "Van Nguyen <the.gol.effect@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -0,0 +0,0 @@ <a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a> |
@@ -0,0 +0,0 @@ // Load modules |
@@ -0,0 +0,0 @@ // Load modules |
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
288832
3190