pg-mvc-service 2.0.54 → 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.
|
@@ -63,29 +63,29 @@ class ResponseType extends ReqResType_1.default {
|
|
|
63
63
|
if (objectProperty.type !== 'object' && objectProperty.type !== 'object?') {
|
|
64
64
|
throw new Error(`getObjectメソッドでObject型以外が入力された場合はエラー\n keys: ${keys.join(',')}`);
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
66
|
+
console.log(objectProperty);
|
|
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;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return resData;
|
package/package.json
CHANGED
|
@@ -65,31 +65,31 @@ export class ResponseType extends ReqResType {
|
|
|
65
65
|
throw new Error(`getObjectメソッドでObject型以外が入力された場合はエラー\n keys: ${keys.join(',')}`);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
console.log(objectProperty);
|
|
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;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|