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