Socket
Socket
Sign inDemoInstall

jsonschema

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonschema - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

8

lib/attribute.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc