badmfck-api-server 3.3.4 → 3.3.6
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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
|
|
95
95
|
exports.Initializer = Initializer;
|
96
96
|
class APIService extends BaseService_1.BaseService {
|
97
97
|
static nextLogID = 0;
|
98
|
-
version = "3.3.
|
98
|
+
version = "3.3.6";
|
99
99
|
options;
|
100
100
|
monitor = null;
|
101
101
|
started = new Date();
|
@@ -181,8 +181,15 @@ class Validator {
|
|
181
181
|
return;
|
182
182
|
if (typeof structure !== "object" || typeof object !== "object")
|
183
183
|
return;
|
184
|
-
if (Array.isArray(structure))
|
184
|
+
if (Array.isArray(structure)) {
|
185
|
+
if (!Array.isArray(object))
|
186
|
+
return;
|
187
|
+
if (structure.length < 1)
|
188
|
+
return;
|
189
|
+
for (let i of object)
|
190
|
+
this.filterStructure(structure[0], i);
|
185
191
|
return;
|
192
|
+
}
|
186
193
|
for (let key in object) {
|
187
194
|
if (!(key in structure)) {
|
188
195
|
delete object[key];
|
@@ -190,7 +197,8 @@ class Validator {
|
|
190
197
|
}
|
191
198
|
if (key.startsWith("$__"))
|
192
199
|
delete object[key];
|
193
|
-
|
200
|
+
if (typeof object[key] === "object")
|
201
|
+
this.filterStructure(structure[key], object[key]);
|
194
202
|
}
|
195
203
|
}
|
196
204
|
static syncStructure(structure, object) {
|