Class ZodFunction<Args, Returns>

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

spa: (
    data: unknown,
    params?: Partial<ParseParams>,
) => Promise<
    SafeParseReturnType<
        InnerTypeOfFunction<Args, Returns>,
        OuterTypeOfFunction<Args, Returns>,
    >,
>

Alias of safeParseAsync

validate: <F extends (...args: any[any]) => Returns["_input"]>(
    func: F,
) => ReturnType<F> extends Returns["_output"]
    ? (...args: Args["_input"]) => ReturnType<ReturnType<F>>
    : OuterTypeOfFunction<Args, Returns>

Accessors

  • get description(): undefined | string
  • Returns undefined | string

Methods

  • Parameters

    Returns string

  • Parameters

    • description: string

    Returns this

  • Type Parameters

    • F extends (...args: any[any]) => Returns["_input"]

    Parameters

    • func: F

    Returns ReturnType<F> extends Returns["_output"]
        ? (...args: Args["_input"]) => ReturnType<ReturnType<F>>
        : OuterTypeOfFunction<Args, Returns>

  • Returns boolean

  • Returns boolean

  • Returns Args

  • Returns Returns