jsonpolice
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -199,24 +199,27 @@ 'use strict'; | ||
path = path || ''; | ||
try { | ||
if (enumerableAndDefined(this.data, 'type')) { | ||
data = this.validateType(data, path); | ||
data = this.default(data); | ||
if (typeof data !== 'undefined') { | ||
try { | ||
if (enumerableAndDefined(this.data, 'type')) { | ||
data = this.validateType(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'enum')) { | ||
data = this.validateEnum(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'allOf')) { | ||
data = this.validateAllOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'anyOf')) { | ||
data = this.validateAnyOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'oneOf')) { | ||
data = this.validateOneOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'not')) { | ||
data = this.validateNot(data, path); | ||
} | ||
} catch (e) { | ||
delete this[__validating]; | ||
throw e; | ||
} | ||
if (enumerableAndDefined(this.data, 'enum')) { | ||
data = this.validateEnum(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'allOf')) { | ||
data = this.validateAllOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'anyOf')) { | ||
data = this.validateAnyOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'oneOf')) { | ||
data = this.validateOneOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'not')) { | ||
data = this.validateNot(data, path); | ||
} | ||
} catch (e) { | ||
delete this[__validating]; | ||
throw e; | ||
} | ||
@@ -586,3 +589,2 @@ delete this[__validating]; | ||
value: function validateType(data, path) { | ||
data = this.default(data); | ||
var props = Object.keys(data); | ||
@@ -589,0 +591,0 @@ if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== 'object' || Array.isArray(data)) { |
{ | ||
"name": "jsonpolice", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "JSON Schema parser and validator", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -137,24 +137,27 @@ import _ from 'lodash'; | ||
path = path || ''; | ||
try { | ||
if (enumerableAndDefined(this.data, 'type')) { | ||
data = this.validateType(data, path); | ||
data = this.default(data); | ||
if (typeof data !== 'undefined') { | ||
try { | ||
if (enumerableAndDefined(this.data, 'type')) { | ||
data = this.validateType(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'enum')) { | ||
data = this.validateEnum(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'allOf')) { | ||
data = this.validateAllOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'anyOf')) { | ||
data = this.validateAnyOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'oneOf')) { | ||
data = this.validateOneOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'not')) { | ||
data = this.validateNot(data, path); | ||
} | ||
} catch(e) { | ||
delete this[__validating]; | ||
throw e; | ||
} | ||
if (enumerableAndDefined(this.data, 'enum')) { | ||
data = this.validateEnum(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'allOf')) { | ||
data = this.validateAllOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'anyOf')) { | ||
data = this.validateAnyOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'oneOf')) { | ||
data = this.validateOneOf(data, path); | ||
} | ||
if (enumerableAndDefined(this.data, 'not')) { | ||
data = this.validateNot(data, path); | ||
} | ||
} catch(e) { | ||
delete this[__validating]; | ||
throw e; | ||
} | ||
@@ -442,3 +445,2 @@ delete this[__validating]; | ||
validateType(data, path) { | ||
data = this.default(data); | ||
var props = Object.keys(data); | ||
@@ -445,0 +447,0 @@ if (typeof data !== 'object' || Array.isArray(data)) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported 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
1589
167513