rads-db 0.1.2 → 0.1.4
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/index.cjs +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,7 +52,10 @@ function getFieldZodSchemaBase(zodSchemas, schema, field, shouldBeLazy) {
|
|
|
52
52
|
if (field.type === "number")
|
|
53
53
|
return zod.z.number();
|
|
54
54
|
if (schema[field.type]) {
|
|
55
|
-
const getSchema = () =>
|
|
55
|
+
const getSchema = () => {
|
|
56
|
+
const zodSchema = getZodSchema(zodSchemas, schema, field.type);
|
|
57
|
+
return zodSchema.deepPartial().required({ id: true });
|
|
58
|
+
};
|
|
56
59
|
return shouldBeLazy ? zod.z.lazy(getSchema) : getSchema();
|
|
57
60
|
}
|
|
58
61
|
throw new Error(`Unknown type: ${field.type}`);
|
package/dist/index.mjs
CHANGED
|
@@ -45,7 +45,10 @@ function getFieldZodSchemaBase(zodSchemas, schema, field, shouldBeLazy) {
|
|
|
45
45
|
if (field.type === "number")
|
|
46
46
|
return z.number();
|
|
47
47
|
if (schema[field.type]) {
|
|
48
|
-
const getSchema = () =>
|
|
48
|
+
const getSchema = () => {
|
|
49
|
+
const zodSchema = getZodSchema(zodSchemas, schema, field.type);
|
|
50
|
+
return zodSchema.deepPartial().required({ id: true });
|
|
51
|
+
};
|
|
49
52
|
return shouldBeLazy ? z.lazy(getSchema) : getSchema();
|
|
50
53
|
}
|
|
51
54
|
throw new Error(`Unknown type: ${field.type}`);
|