ZodSchemaClassBuilder work
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-03-09 01:29:38 +01:00
parent 81efdaab01
commit 12b73e39e3
3 changed files with 16 additions and 18 deletions

View File

@@ -27,8 +27,8 @@ export const ZodSchemaObject = <
schemaWithDefaultValues: z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>,
) => trait
.implement(Super => class ZodSchemaObject extends Super {
static readonly schema = schema
static readonly schemaWithDefaultsValues = schemaWithDefaultValues
static readonly schema = schema
static readonly schemaWithDefaultValues = schemaWithDefaultValues
static transform<
Instance extends Values,
@@ -56,7 +56,7 @@ export const ZodSchemaObject = <
...[values, params]: CreateArgs<PartialValues>
) {
return this
.transform(this.schemaWithDefaultsValues)
.transform(this.schemaWithDefaultValues)
.parse(values, params)
}
@@ -70,7 +70,7 @@ export const ZodSchemaObject = <
...[values, params]: CreateArgs<PartialValues>
) {
return this
.transform(this.schemaWithDefaultsValues)
.transform(this.schemaWithDefaultValues)
.parseAsync(values, params)
}
@@ -84,7 +84,7 @@ export const ZodSchemaObject = <
...[values, params]: CreateArgs<PartialValues>
) {
return parseZodSchemaEffect(
this.transform(this.schemaWithDefaultsValues),
this.transform(this.schemaWithDefaultValues),
values,
params,
)