0.1.2 #3
@@ -56,7 +56,7 @@ extends TraitExpressionBuilder<Superclass, Traits> {
|
|||||||
StaticMembers<Super>
|
StaticMembers<Super>
|
||||||
),
|
),
|
||||||
|
|
||||||
[...this.expressionTraits, ZodSchemaObject(schema, schemaWithDefaultValues)],
|
[...this.expressionTraits, ZodSchemaObject(schema, schemaWithDefaultValues(schema))],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,15 +25,12 @@ export const ZodSchemaObject = <
|
|||||||
Values extends object,
|
Values extends object,
|
||||||
PartialValues extends Partial<Values>,
|
PartialValues extends Partial<Values>,
|
||||||
>(
|
>(
|
||||||
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>,
|
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>,
|
||||||
|
schemaWithDefaultValues: z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>,
|
||||||
schemaWithDefaultValues: (
|
|
||||||
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>
|
|
||||||
) => z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>,
|
|
||||||
) => trait
|
) => trait
|
||||||
.implement(Super => class ZodSchemaObject extends Super {
|
.implement(Super => class ZodSchemaObject extends Super {
|
||||||
static readonly schema = schema
|
static readonly schema = schema
|
||||||
static readonly schemaWithDefaultsValues = schemaWithDefaultValues(schema)
|
static readonly schemaWithDefaultsValues = schemaWithDefaultValues
|
||||||
|
|
||||||
static instantiationTransform<
|
static instantiationTransform<
|
||||||
Instance extends Values,
|
Instance extends Values,
|
||||||
|
|||||||
Reference in New Issue
Block a user