Fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julien Valverdé
2024-03-09 05:32:46 +01:00
parent 4061e26e35
commit bea12d3c66

View File

@@ -37,25 +37,23 @@ export const JsonifiableZodSchemaObject = <
.build()
.subtrait()
.implement(Super => class JsonifiableZodSchemaObject extends Super {
declare ["constructor"]: typeof JsonifiableZodSchemaObject
static readonly jsonifySchema = jsonifySchema
static readonly dejsonifySchema = dejsonifySchema
jsonify(params?: Partial<z.ParseParams>) {
return (this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>)
.jsonifySchema
.parse(this, params)
return this.constructor.jsonifySchema.parse(this, params)
}
jsonifyPromise(params?: Partial<z.ParseParams>) {
return (this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>)
.jsonifySchema
.parseAsync(this, params)
return this.constructor.jsonifySchema.parseAsync(this, params)
}
jsonifyEffect(params?: Partial<z.ParseParams>) {
return parseZodSchemaEffect(
(this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>).jsonifySchema,
this.constructor.jsonifySchema,
this,
params,
)