jsonschema
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -22,9 +22,5 @@ 'use strict'; | ||
// Ignored attributes, mostly due to that they are handled differently. | ||
var IGNORED_ATTRIBUTES = [ | ||
"exclusiveMinimum", "exclusiveMaximum", "default" | ||
]; | ||
Attribute.prototype.validate = function () { | ||
if (IGNORED_ATTRIBUTES.indexOf(this.name) !== -1) { | ||
// Ignored attributes, mostly due to that they are handled differently. | ||
if (this.name === "exclusiveMinimum" || this.name === "exclusiveMaximum" || this.name === "default") { | ||
return null; | ||
@@ -31,0 +27,0 @@ } |
@@ -50,11 +50,15 @@ 'use strict'; | ||
Validator.prototype.validateSchema = function (instance, schema, options) { | ||
var basicTypes = ['string', 'number', 'integer', 'boolean', 'null', 'date', 'any']; | ||
if (helpers.isDefined(schema.type)) { | ||
if (basicTypes.indexOf(schema.type) >= 0) { | ||
switch (schema.type) { | ||
case 'string': | ||
case 'number': | ||
case 'integer': | ||
case 'boolean': | ||
case 'null': | ||
case 'date': | ||
case 'any': | ||
return this.validateProperty(instance, schema, options); | ||
} | ||
if (schema.type === 'object') { | ||
case 'object': | ||
return this.validateObject(instance, schema, options); | ||
} | ||
if (schema.type === 'array') { | ||
case 'array': | ||
return this.validateArray(instance, schema, options); | ||
@@ -61,0 +65,0 @@ } |
{ | ||
"author": "Tom de Grunt <tom@degrunt.nl>", | ||
"name": "jsonschema", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "mocha": "~1.3.0", |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
1122
48204
1