Skip to main content

lazy()

lazy<T>(getter, message?): LazySchema<T>

Lazy schema - allows creating recursive types by deferring evaluation.


Type Parameters​

T: T​


Parameters​

getter: () => Schema<T>​

Function that returns the schema to evaluate.

message?: string​

Custom error message.


Returns: LazySchema<T>​

Lazy schema that evaluates the schema on demand.


Since​

2.0.0