Comparing version 1.0.0 to 1.1.0
109
index.js
@@ -174,12 +174,32 @@ "use strict"; | ||
value: function generate() { | ||
var variables = this.state.variables; | ||
this.res = {}; | ||
var _this$state = this.state, | ||
variables = _this$state.variables, | ||
json = _this$state.json; | ||
for (var i = 0; i < variables.length; i++) { | ||
var variable = variables[i]; | ||
var name = variable.name; | ||
this.res[name] = this.generateReq(variable); | ||
if (json === false) { | ||
return; | ||
} | ||
return this.res; | ||
var type = this.getType(json); | ||
if (type === 'object') { | ||
this.res = {}; | ||
for (var i = 0; i < variables.length; i++) { | ||
var variable = variables[i]; | ||
var name = variable.name; | ||
this.res[name] = this.generateReq(variable); | ||
} | ||
return this.res; | ||
} else if (type === 'array') { | ||
this.res = []; | ||
for (var _i = 0; _i < variables.length; _i++) { | ||
var _variable = variables[_i]; | ||
this.res.push(this.generateReq(_variable)); | ||
} | ||
return this.res; | ||
} | ||
} | ||
@@ -209,4 +229,4 @@ }, { | ||
for (var _i = 0; _i < value.length; _i++) { | ||
_res[value[_i].name] = this.generateReq(value[_i]); | ||
for (var _i2 = 0; _i2 < value.length; _i2++) { | ||
_res[value[_i2].name] = this.generateReq(value[_i2]); | ||
} | ||
@@ -370,6 +390,6 @@ | ||
var _this$state = this.state, | ||
indent = _this$state.indent, | ||
height = _this$state.height, | ||
fontSize = _this$state.fontSize; | ||
var _this$state2 = this.state, | ||
indent = _this$state2.indent, | ||
height = _this$state2.height, | ||
fontSize = _this$state2.fontSize; | ||
return { | ||
@@ -528,10 +548,10 @@ size: 24, | ||
value = _o$value === void 0 ? type === 'text' ? '' : 0 : _o$value, | ||
_this$state2 = this.state, | ||
variables = _this$state2.variables, | ||
indent = _this$state2.indent, | ||
height = _this$state2.height, | ||
variableColor = _this$state2.variableColor, | ||
numberColor = _this$state2.numberColor, | ||
textColor = _this$state2.textColor, | ||
border = _this$state2.border; | ||
_this$state3 = this.state, | ||
variables = _this$state3.variables, | ||
indent = _this$state3.indent, | ||
height = _this$state3.height, | ||
variableColor = _this$state3.variableColor, | ||
numberColor = _this$state3.numberColor, | ||
textColor = _this$state3.textColor, | ||
border = _this$state3.border; | ||
var color = type === 'text' ? textColor : numberColor; | ||
@@ -618,9 +638,9 @@ return { | ||
value = o.value, | ||
_this$state3 = this.state, | ||
variables = _this$state3.variables, | ||
indent = _this$state3.indent, | ||
height = _this$state3.height, | ||
variableColor = _this$state3.variableColor, | ||
booleanColor = _this$state3.booleanColor, | ||
border = _this$state3.border; | ||
_this$state4 = this.state, | ||
variables = _this$state4.variables, | ||
indent = _this$state4.indent, | ||
height = _this$state4.height, | ||
variableColor = _this$state4.variableColor, | ||
booleanColor = _this$state4.booleanColor, | ||
border = _this$state4.border; | ||
return { | ||
@@ -711,8 +731,8 @@ attrs: { | ||
_open = _o$_open2 === void 0 ? true : _o$_open2, | ||
_this$state4 = this.state, | ||
variables = _this$state4.variables, | ||
indent = _this$state4.indent, | ||
height = _this$state4.height, | ||
variableColor = _this$state4.variableColor, | ||
border = _this$state4.border, | ||
_this$state5 = this.state, | ||
variables = _this$state5.variables, | ||
indent = _this$state5.indent, | ||
height = _this$state5.height, | ||
variableColor = _this$state5.variableColor, | ||
border = _this$state5.border, | ||
column = []; | ||
@@ -848,5 +868,6 @@ | ||
var _this$state5 = this.state, | ||
variables = _this$state5.variables, | ||
_open = _this$state5._open, | ||
var _this$state6 = this.state, | ||
variables = _this$state6.variables, | ||
_open = _this$state6._open, | ||
json = _this$state6.json, | ||
column = []; | ||
@@ -900,3 +921,3 @@ var _this$props = this.props, | ||
_this10.setState({ | ||
generated: JSON.stringify(_this10.generate(), undefined, 4) | ||
generated: JSON.stringify(_this10.generate(json), undefined, 4) | ||
}); | ||
@@ -935,8 +956,8 @@ } | ||
var _this$state6 = this.state, | ||
variables = _this$state6.variables, | ||
_open = _this$state6._open, | ||
fontSize = _this$state6.fontSize, | ||
generated = _this$state6.generated, | ||
json = _this$state6.json, | ||
var _this$state7 = this.state, | ||
variables = _this$state7.variables, | ||
_open = _this$state7._open, | ||
fontSize = _this$state7.fontSize, | ||
generated = _this$state7.generated, | ||
json = _this$state7.json, | ||
column = []; | ||
@@ -943,0 +964,0 @@ var _this$props2 = this.props, |
{ | ||
"name": "aio-json", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "generate json interactive", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
36410
1075