0.1.3 #4
@@ -8,7 +8,7 @@ import { Extend, StaticMembers } from "./util"
|
||||
export function ExtendZodSchemaClass<
|
||||
Self extends (
|
||||
AbstractClass<
|
||||
TraitInstance<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>> & Values,
|
||||
Values & TraitInstance<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>>,
|
||||
[values: Values]
|
||||
> &
|
||||
TraitStaticMembers<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>>
|
||||
@@ -26,7 +26,7 @@ export function ExtendZodSchemaClass<
|
||||
>(
|
||||
class_: Self | (
|
||||
AbstractClass<
|
||||
TraitInstance<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>> & Values,
|
||||
Values & TraitInstance<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>>,
|
||||
[values: Values]
|
||||
> &
|
||||
TraitStaticMembers<ZodSchemaObjectTrait<T, Catchall, Values, PartialValues>>
|
||||
|
||||
@@ -85,6 +85,7 @@ export const JsonifiedZodSchemaObject = <
|
||||
params?: Partial<z.ParseParams>,
|
||||
) {
|
||||
const t = implStaticInstantiableThis(JsonifiedZodSchemaObjectImpl, this)
|
||||
|
||||
return t
|
||||
.pipeSchemaIntoInstance(t.jsonifySchema)
|
||||
.parse(values, params)
|
||||
@@ -98,6 +99,7 @@ export const JsonifiedZodSchemaObject = <
|
||||
params?: Partial<z.ParseParams>,
|
||||
) {
|
||||
const t = implStaticInstantiableThis(JsonifiedZodSchemaObjectImpl, this)
|
||||
|
||||
return t
|
||||
.pipeSchemaIntoInstance(t.jsonifySchema)
|
||||
.parseAsync(values, params)
|
||||
@@ -111,6 +113,7 @@ export const JsonifiedZodSchemaObject = <
|
||||
params?: Partial<z.ParseParams>,
|
||||
) {
|
||||
const t = implStaticInstantiableThis(JsonifiedZodSchemaObjectImpl, this)
|
||||
|
||||
return parseZodSchemaEffect(
|
||||
t.pipeSchemaIntoInstance(t.jsonifySchema),
|
||||
values,
|
||||
|
||||
@@ -63,6 +63,7 @@ export const ZodSchemaObject = <
|
||||
...[values, params]: CreateArgs<PartialValues>
|
||||
) {
|
||||
const t = implStaticInstantiableThis(ZodSchemaObjectImpl, this)
|
||||
|
||||
return t
|
||||
.pipeSchemaIntoInstance(t.schemaWithDefaults)
|
||||
.parse(values, params)
|
||||
@@ -75,6 +76,7 @@ export const ZodSchemaObject = <
|
||||
...[values, params]: CreateArgs<PartialValues>
|
||||
) {
|
||||
const t = implStaticInstantiableThis(ZodSchemaObjectImpl, this)
|
||||
|
||||
return t
|
||||
.pipeSchemaIntoInstance(t.schemaWithDefaults)
|
||||
.parseAsync(values, params)
|
||||
@@ -87,6 +89,7 @@ export const ZodSchemaObject = <
|
||||
...[values, params]: CreateArgs<PartialValues>
|
||||
) {
|
||||
const t = implStaticInstantiableThis(ZodSchemaObjectImpl, this)
|
||||
|
||||
return parseZodSchemaEffect(
|
||||
t.pipeSchemaIntoInstance(t.schemaWithDefaults),
|
||||
values,
|
||||
|
||||
Reference in New Issue
Block a user