ZodSchemaObject fix
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-02-28 04:53:33 +01:00
parent 69d47ba3cf
commit aefca6657b
2 changed files with 4 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
StaticMembers<Super>
),
[...this.expressionTraits, ZodSchemaObject(schema, schemaWithDefaultValues)],
[...this.expressionTraits, ZodSchemaObject(schema, schemaWithDefaultValues(schema))],
)
}

View File

@@ -26,14 +26,11 @@ export const ZodSchemaObject = <
PartialValues extends Partial<Values>,
>(
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>,
schemaWithDefaultValues: (
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>
) => z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>,
schemaWithDefaultValues: z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>,
) => trait
.implement(Super => class ZodSchemaObject extends Super {
static readonly schema = schema
static readonly schemaWithDefaultsValues = schemaWithDefaultValues(schema)
static readonly schemaWithDefaultsValues = schemaWithDefaultValues
static instantiationTransform<
Instance extends Values,