@zenstackhq/orm 3.9.1 → 3.9.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/index.cjs CHANGED
@@ -2638,7 +2638,7 @@ var ZodSchemaFactory = class {
2638
2638
  makeTypeDefSchema(type) {
2639
2639
  const typeDef = getTypeDef(this.schema, type);
2640
2640
  (0, _zenstackhq_common_helpers.invariant)(typeDef, `Type definition "${type}" not found in schema`);
2641
- const schema = zod.z.looseObject(Object.fromEntries(Object.entries(typeDef.fields).map(([field, def]) => {
2641
+ const schema = (typeDef.strict ? zod.z.strictObject : zod.z.looseObject)(Object.fromEntries(Object.entries(typeDef.fields).map(([field, def]) => {
2642
2642
  let fieldSchema = isTypeDef(this.schema, def.type) ? zod.z.lazy(() => this.makeTypeDefSchema(def.type)) : this.makeScalarSchema(def.type);
2643
2643
  if (def.array) fieldSchema = fieldSchema.array();
2644
2644
  if (def.optional) fieldSchema = fieldSchema.nullish();