0.1.2 #3
@@ -41,6 +41,27 @@ export const JsonifiableZodSchemaObject = <
|
||||
static readonly dejsonifySchema = dejsonifySchema
|
||||
|
||||
|
||||
jsonify(params?: Partial<z.ParseParams>) {
|
||||
return (this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>)
|
||||
.jsonifySchema
|
||||
.parse(this, params)
|
||||
}
|
||||
|
||||
jsonifyPromise(params?: Partial<z.ParseParams>) {
|
||||
return (this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>)
|
||||
.jsonifySchema
|
||||
.parseAsync(this, params)
|
||||
}
|
||||
|
||||
jsonifyEffect(params?: Partial<z.ParseParams>) {
|
||||
return parseZodSchemaEffect(
|
||||
(this.constructor as unknown as ImplStatic<typeof JsonifiableZodSchemaObject>).jsonifySchema,
|
||||
this,
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
static dejsonify<
|
||||
Instance extends Values
|
||||
>(
|
||||
|
||||
Reference in New Issue
Block a user