@dzeio/schema 0.3.1 → 0.3.2
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/Schema.js +3 -2
- package/dist/Schema.mjs +3 -2
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -354,6 +354,7 @@ var SchemaObject = class extends SchemaItem {
|
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
356
|
const clone = (0, import_object_util2.objectClone)(object);
|
|
357
|
+
const res = {};
|
|
357
358
|
(0, import_object_util2.objectLoop)(this.model, (childSchema, key) => {
|
|
358
359
|
const childValue = clone[key];
|
|
359
360
|
const child = childSchema.parse(childValue);
|
|
@@ -363,13 +364,13 @@ var SchemaObject = class extends SchemaItem {
|
|
|
363
364
|
field: it.field ? `${key}.${it.field}` : key
|
|
364
365
|
})));
|
|
365
366
|
}
|
|
366
|
-
|
|
367
|
+
res[key] = child.object;
|
|
367
368
|
return child.valid || !(options == null ? void 0 : options.fast);
|
|
368
369
|
});
|
|
369
370
|
return {
|
|
370
371
|
valid: errors.length === 0,
|
|
371
372
|
errors,
|
|
372
|
-
object:
|
|
373
|
+
object: res
|
|
373
374
|
};
|
|
374
375
|
}
|
|
375
376
|
isOfType(input) {
|
package/dist/Schema.mjs
CHANGED
|
@@ -311,6 +311,7 @@ var SchemaObject = class extends SchemaItem {
|
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
313
|
const clone = objectClone(object);
|
|
314
|
+
const res = {};
|
|
314
315
|
objectLoop(this.model, (childSchema, key) => {
|
|
315
316
|
const childValue = clone[key];
|
|
316
317
|
const child = childSchema.parse(childValue);
|
|
@@ -320,13 +321,13 @@ var SchemaObject = class extends SchemaItem {
|
|
|
320
321
|
field: it.field ? `${key}.${it.field}` : key
|
|
321
322
|
})));
|
|
322
323
|
}
|
|
323
|
-
|
|
324
|
+
res[key] = child.object;
|
|
324
325
|
return child.valid || !(options == null ? void 0 : options.fast);
|
|
325
326
|
});
|
|
326
327
|
return {
|
|
327
328
|
valid: errors.length === 0,
|
|
328
329
|
errors,
|
|
329
|
-
object:
|
|
330
|
+
object: res
|
|
330
331
|
};
|
|
331
332
|
}
|
|
332
333
|
isOfType(input) {
|