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 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 = () => getZodSchema(zodSchemas, schema, field.type);
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 = () => getZodSchema(zodSchemas, schema, field.type);
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}`);
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "require": "./integrations/*.cjs"
26
26
  }
27
27
  },
28
- "version": "0.1.2",
28
+ "version": "0.1.4",
29
29
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
30
30
  "keywords": [],
31
31
  "author": "",