pg-mvc-service 2.0.55 → 2.0.56
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.
|
@@ -64,30 +64,28 @@ class ResponseType extends ReqResType_1.default {
|
|
|
64
64
|
throw new Error(`getObjectメソッドでObject型以外が入力された場合はエラー\n keys: ${keys.join(',')}`);
|
|
65
65
|
}
|
|
66
66
|
console.log(objectProperty);
|
|
67
|
-
for (const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
67
|
+
for (const key of Object.keys(objectProperty.properties)) {
|
|
68
|
+
console.log(key);
|
|
69
|
+
if (key in data === false || data[key] === undefined) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const property = objectProperty.properties[key];
|
|
73
|
+
if (data[key] === null || (property.type.replace("?", "") !== "string" && data[key] === "")) {
|
|
74
|
+
resData[key] = property.type.endsWith('?') ? null : undefined;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
switch (property.type) {
|
|
78
|
+
case 'object':
|
|
79
|
+
case 'object?':
|
|
80
|
+
resData[key] = this.getObject([...keys, key]);
|
|
81
|
+
break;
|
|
82
|
+
case 'array':
|
|
83
|
+
case 'array?':
|
|
84
|
+
resData[key] = this.getArray([...keys, key]);
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
resData[key] = this.getValue([...keys, key]);
|
|
88
|
+
break;
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
91
|
return resData;
|
|
@@ -112,9 +110,7 @@ class ResponseType extends ReqResType_1.default {
|
|
|
112
110
|
switch (arrayProperty.properties.type) {
|
|
113
111
|
case 'object':
|
|
114
112
|
case 'object?':
|
|
115
|
-
|
|
116
|
-
console.log(value);
|
|
117
|
-
resData.push(value);
|
|
113
|
+
resData.push(this.getObject([...keys, i]));
|
|
118
114
|
break;
|
|
119
115
|
case 'array':
|
|
120
116
|
case 'array?':
|
package/package.json
CHANGED
|
@@ -66,32 +66,30 @@ export class ResponseType extends ReqResType {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
console.log(objectProperty);
|
|
69
|
-
for (const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
69
|
+
for (const key of Object.keys(objectProperty.properties)) {
|
|
70
|
+
console.log(key);
|
|
71
|
+
if (key in data === false || data[key] === undefined) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const property = objectProperty.properties[key];
|
|
76
|
+
if (data[key] === null || (property.type.replace("?", "") !== "string" && data[key] === "")) {
|
|
77
|
+
resData[key] = property.type.endsWith('?') ? null : undefined;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
switch (property.type) {
|
|
82
|
+
case 'object':
|
|
83
|
+
case 'object?':
|
|
84
|
+
resData[key] = this.getObject([...keys, key]);
|
|
85
|
+
break;
|
|
86
|
+
case 'array':
|
|
87
|
+
case 'array?':
|
|
88
|
+
resData[key] = this.getArray([...keys, key]);
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
resData[key] = this.getValue([...keys, key]);
|
|
92
|
+
break;
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
|
|
@@ -121,9 +119,7 @@ export class ResponseType extends ReqResType {
|
|
|
121
119
|
switch (arrayProperty.properties.type) {
|
|
122
120
|
case 'object':
|
|
123
121
|
case 'object?':
|
|
124
|
-
|
|
125
|
-
console.log(value)
|
|
126
|
-
resData.push(value);
|
|
122
|
+
resData.push(this.getObject([...keys, i]));
|
|
127
123
|
break;
|
|
128
124
|
case 'array':
|
|
129
125
|
case 'array?':
|