New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fake-json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake-json - npm Package Compare versions

Comparing version

to
0.0.3

39

index.js

@@ -69,14 +69,32 @@ 'use strict';

var range;
var min = schema.minItems;
var max = schema.maxItems;
min = (min != null ? min : 1);
max = (max != null ? max : (min + 5));
if (_.isArray(schema.items)) {
return _.map(schema.items, function (item) {
var items = _.map(schema.items, function (item) {
return this.generate(item, depth + 1);
}, this);
if (schema.additionalItems) {
range = _.range(this.number({
minimum: Math.max(1, min - items.length),
maximum: Math.max(1, max - items.length)
}));
items.push.apply(items, _.map(range, function () {
return this.generate(schema.additionalItems, depth + 1);
}, this));
}
return items;
}
else if (_.isObject(schema.items)) {
var min = schema.minItems;
var max = schema.maxItems;
var range = _.range(this.number({
minimum: (min != null ? min : 1),
maximum: (max != null ? max : 10)
if (_.isObject(schema.items)) {
range = _.range(this.number({
minimum: min,
maximum: max
}));

@@ -118,5 +136,8 @@

min = (min != null ? min : 1) + (xmin ? 1 : 0);
max = (max != null ? max : (min + 5)) - (xmax ? 1 : 0);
return namespace(Faker, 'random.number')({
min: (min != null ? min : 1) + (xmin ? 1 : 0),
max: (max != null ? max : 10) - (xmax ? 1 : 0)
min: min,
max: max
});

@@ -123,0 +144,0 @@ };

{
"name": "fake-json",
"description": "Generate fake data based on a JSON schema.",
"version": "0.0.2",
"version": "0.0.3",

@@ -6,0 +6,0 @@ "author": {