Comparing version 2.2.2 to 2.2.3
12
index.js
@@ -112,4 +112,6 @@ /*! | ||
function validateObjectEntity ( modelObject, entity, parents, errors ) { | ||
if( !errors ) errors = {}; | ||
if( !parents ) parents = []; | ||
if(!errors) errors = {}; | ||
if(!errors.text) errors.text = []; | ||
if(!parents) parents = []; | ||
for( var key in entity ){ | ||
@@ -120,5 +122,2 @@ var fieldName = parents + '.' + key; | ||
errors.notRequired.push(fieldName); | ||
if(!errors.text) errors.text = []; | ||
errors.text.push('Field ' + fieldName + ' not required'); | ||
@@ -131,4 +130,2 @@ } | ||
if(!errors.notMatched) errors.notMatched = {}; | ||
if(!errors.text) errors.text = []; | ||
errors.notMatched[fieldName] = modelObject[key].type; | ||
@@ -161,2 +158,3 @@ errors.text.push('Field ' + fieldName + ' not matched with type ' + modelObject[key].type); | ||
); | ||
if(!errors.text[0]) errors = {}; | ||
if(errors && errors.text) errors.text = errors.text.join('. '); | ||
@@ -163,0 +161,0 @@ |
{ | ||
"name": "2valid", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "JavaScript simple data validator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
49334