is-my-json-valid
Advanced tools
Comparing version 2.12.2 to 2.12.3
30
index.js
@@ -193,3 +193,3 @@ var genobj = require('generate-object-property') | ||
validate('}') | ||
} | ||
} | ||
} | ||
@@ -399,3 +399,3 @@ | ||
validate('var %s = errors', prev) | ||
} else { | ||
} else { | ||
validate('if (errors !== %s) {', prev) | ||
@@ -451,3 +451,3 @@ ('errors = %s', prev) | ||
if (type !== 'object') validate('if (%s) {', types.object(name)) | ||
validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties) | ||
@@ -462,3 +462,3 @@ error('has more properties than allowed') | ||
if (type !== 'object') validate('if (%s) {', types.object(name)) | ||
validate('if (Object.keys(%s).length < %d) {', name, node.minProperties) | ||
@@ -473,3 +473,3 @@ error('has less properties than allowed') | ||
if (type !== 'array') validate('if (%s) {', types.array(name)) | ||
validate('if (%s.length > %d) {', name, node.maxItems) | ||
@@ -484,3 +484,3 @@ error('has more items than allowed') | ||
if (type !== 'array') validate('if (%s) {', types.array(name)) | ||
validate('if (%s.length < %d) {', name, node.minItems) | ||
@@ -552,10 +552,12 @@ error('has less items than allowed') | ||
validate.__defineGetter__('error', function() { | ||
if (!validate.errors) return '' | ||
return validate.errors | ||
.map(function(err) { | ||
return err.field+' '+err.message | ||
}) | ||
.join('\n') | ||
}) | ||
if (Object.defineProperty) { | ||
Object.defineProperty(validate, 'error', { | ||
get: function() { | ||
if (!validate.errors) return '' | ||
return validate.errors.map(function(err) { | ||
return err.field + ' ' + err.message; | ||
}).join('\n') | ||
} | ||
}) | ||
} | ||
@@ -562,0 +564,0 @@ validate.toJSON = function() { |
{ | ||
"name": "is-my-json-valid", | ||
"version": "2.12.2", | ||
"version": "2.12.3", | ||
"description": "A JSONSchema validator that uses code generation to be extremely fast", | ||
@@ -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
102894
3294