Comparing version 0.1.2 to 0.1.3
function (data, dataType, dataPath) { | ||
'use strict'; | ||
/* TODO change to inline ??? */ | ||
@@ -5,0 +4,0 @@ var errs = validate.errors.length; |
@@ -1,21 +0,17 @@ | ||
var valid = true, missing = ''; | ||
var req_schema = validate.schema{{= it.schemaPath + '.required' }}; | ||
{{ var $req_schema = it.schema.required; }} | ||
{{? $req_schema.length <= 100 }} | ||
var valid = {{~ $req_schema:$req_property:$i }} | ||
{{? $i}} && {{?}} | ||
data.hasOwnProperty('{{= it.escapeQuotes($req_property) }}') | ||
{{~}}; | ||
{{??}} | ||
var valid = true; | ||
var req_schema = validate.schema{{= it.schemaPath + '.required' }}; | ||
for (var i = 0; i < req_schema.length; i++) { | ||
var property = req_schema[i] | ||
, has = data.hasOwnProperty(req_schema[i]) | ||
, valid = valid && has; | ||
for (var i = 0; i < req_schema.length; i++) { | ||
var property = req_schema[i] | ||
, valid = valid && data.hasOwnProperty(req_schema[i]); | ||
if (!has) { | ||
{{? it.opts.allErrors }} | ||
missing += ', ' + property; | ||
{{??}} | ||
missing = property; | ||
break; | ||
{{?}} | ||
{{? !it.opts.allErrors }} if (!valid) break; {{?}} | ||
} | ||
} | ||
{{? it.opts.allErrors }} | ||
missing = missing.slice(2); | ||
{{?}} | ||
@@ -26,4 +22,4 @@ | ||
dataPath: dataPath, | ||
message: 'properties ' + missing + ' are missing' | ||
{{? it.opts.verbose }}, schema: req_schema, data: data{{?}} | ||
message: 'properties {{= $req_schema.slice(0, 7).join(",") }}{{? $req_schema.length > 7}}...{{?}} are required' | ||
{{? it.opts.verbose }}, schema: validate.schema{{= it.schemaPath + '.required' }}, data: data{{?}} | ||
}); |
{ | ||
"name": "ajv", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Another JSON schema Validator", | ||
@@ -5,0 +5,0 @@ "main": "lib/ajv.js", |
@@ -44,2 +44,3 @@ # ajv - Another JSON schema Validator | ||
- _format_: if false, the formats won't be validated (true by default) | ||
- _uniqueItems_: if false, `uniqueItems` keyword will be ignored (true by default) | ||
- _unicode_: if true, the lengths of strings with unicode pairs will be correct (false by default) - not implemented 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
188519
46
5762