gg-express 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GGExpress.js +3 -3
- package/package.json +1 -1
- package/src/GGExpress.ts +4 -4
package/dist/GGExpress.js
CHANGED
|
@@ -38,7 +38,7 @@ class GGExpress {
|
|
|
38
38
|
this.generateStaticRouteFile();
|
|
39
39
|
}
|
|
40
40
|
generateStaticRouteFile() {
|
|
41
|
-
const
|
|
41
|
+
const genParamCode = (data) => {
|
|
42
42
|
let result;
|
|
43
43
|
const resultArray = Object.entries(data["structure"]).map(([key, value]) => ({
|
|
44
44
|
name: key,
|
|
@@ -79,8 +79,8 @@ class GGExpress {
|
|
|
79
79
|
rawString = data
|
|
80
80
|
.map((row) => {
|
|
81
81
|
return ` "${row.url}" : {
|
|
82
|
-
requireParams : { ${
|
|
83
|
-
responseStructure : { ${
|
|
82
|
+
requireParams : { ${genParamCode(row.requireParams)} }${isArray(row.requireParams)},
|
|
83
|
+
responseStructure : { ${genParamCode(row.responseStructure)} }${isArray(row.responseStructure)},
|
|
84
84
|
responseModelInterfaceName : undefined
|
|
85
85
|
} `;
|
|
86
86
|
})
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -219,7 +219,7 @@ export default class GGExpress {
|
|
|
219
219
|
this.generateStaticRouteFile()
|
|
220
220
|
}
|
|
221
221
|
private generateStaticRouteFile() {
|
|
222
|
-
const
|
|
222
|
+
const genParamCode = (data: requireParamsStructure) => {
|
|
223
223
|
let result: string
|
|
224
224
|
const resultArray = Object.entries(data["structure"]).map(
|
|
225
225
|
([key, value]) => ({
|
|
@@ -255,12 +255,12 @@ export default class GGExpress {
|
|
|
255
255
|
rawString = data
|
|
256
256
|
.map((row) => {
|
|
257
257
|
return ` "${row.url}" : {
|
|
258
|
-
requireParams : { ${
|
|
258
|
+
requireParams : { ${genParamCode(
|
|
259
259
|
row.requireParams
|
|
260
260
|
)} }${isArray(row.requireParams)},
|
|
261
|
-
responseStructure : { ${
|
|
261
|
+
responseStructure : { ${genParamCode(
|
|
262
262
|
row.responseStructure
|
|
263
|
-
)} }${isArray(row.
|
|
263
|
+
)} }${isArray(row.responseStructure)},
|
|
264
264
|
responseModelInterfaceName : undefined
|
|
265
265
|
} `
|
|
266
266
|
})
|