schema-inspector
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -83,3 +83,5 @@ /* | ||
for (var key in custom) { | ||
this._custom['$' + key] = custom[key]; | ||
if (custom.hasOwnProperty(key)){ | ||
this._custom['$' + key] = custom[key]; | ||
} | ||
} | ||
@@ -482,5 +484,8 @@ } | ||
for (var key in candidate) { | ||
this._deeperArray(key); | ||
this._validate(items, candidate[key]); | ||
this._back(); | ||
if (candidate.hasOwnProperty(key)){ | ||
this._deeperArray(key); | ||
this._validate(items, candidate[key]); | ||
this._back(); | ||
} | ||
} | ||
@@ -1427,17 +1432,19 @@ } | ||
for (var key in prop) { | ||
if (prop[key].optional === true && _rand.bool() === true) { | ||
continue; | ||
} | ||
if (key !== '*') { | ||
o[key] = this.generate(prop[key]); | ||
} | ||
else { | ||
var rk = '__random_key_'; | ||
var randomKey = rk + 0; | ||
var n = _rand.int(1, 9); | ||
for (var i = 1; i <= n; i++) { | ||
if (!(randomKey in prop)) { | ||
o[randomKey] = this.generate(prop[key]); | ||
if (prop.hasOwnProperty(key)){ | ||
if (prop[key].optional === true && _rand.bool() === true) { | ||
continue; | ||
} | ||
if (key !== '*') { | ||
o[key] = this.generate(prop[key]); | ||
} | ||
else { | ||
var rk = '__random_key_'; | ||
var randomKey = rk + 0; | ||
var n = _rand.int(1, 9); | ||
for (var i = 1; i <= n; i++) { | ||
if (!(randomKey in prop)) { | ||
o[randomKey] = this.generate(prop[key]); | ||
} | ||
randomKey = rk + i; | ||
} | ||
randomKey = rk + i; | ||
} | ||
@@ -1444,0 +1451,0 @@ } |
{ | ||
"name": "schema-inspector", | ||
"description": "Schema-Inspector is a powerful tool to sanitize and validate JS objects.", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
309553
5557