0.1.3 #4
@@ -119,6 +119,35 @@ export const JsonifiedZodSchemaObject = <
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static dejsonify(
|
||||||
|
values: JsonifiedValues,
|
||||||
|
params?: Partial<z.ParseParams>,
|
||||||
|
) {
|
||||||
|
return this.of
|
||||||
|
.pipeSchemaIntoInstance(this.dejsonifySchema)
|
||||||
|
.parse(values, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
static dejsonifyPromise(
|
||||||
|
values: JsonifiedValues,
|
||||||
|
params?: Partial<z.ParseParams>,
|
||||||
|
) {
|
||||||
|
return this.of
|
||||||
|
.pipeSchemaIntoInstance(this.dejsonifySchema)
|
||||||
|
.parseAsync(values, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
static dejsonifyEffect(
|
||||||
|
values: JsonifiedValues,
|
||||||
|
params?: Partial<z.ParseParams>,
|
||||||
|
) {
|
||||||
|
return parseZodSchemaEffect(
|
||||||
|
this.of.pipeSchemaIntoInstance(this.dejsonifySchema),
|
||||||
|
values,
|
||||||
|
params,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
dejsonify(params?: Partial<z.ParseParams>) {
|
dejsonify(params?: Partial<z.ParseParams>) {
|
||||||
return this.constructor.of.pipeSchemaIntoInstance(
|
return this.constructor.of.pipeSchemaIntoInstance(
|
||||||
this.constructor.dejsonifySchema
|
this.constructor.dejsonifySchema
|
||||||
|
|||||||
Reference in New Issue
Block a user