Type Parameters

Hierarchy

Constructors

Properties

_def: ZodCatchDef<T>
_input: unknown
_output: T["_output"]
_type: T["_output"]
spa: ((data, params?) => Promise<SafeParseReturnType<unknown, T["_output"]>>)

Type declaration

create: (<T_1>(type, params) => ZodCatch<T_1>)

Type declaration

    • <T_1>(type, params): ZodCatch<T_1>
    • Type Parameters

      Parameters

      • type: T_1
      • params: {
            description?: string;
            errorMap?: ZodErrorMap;
            invalid_type_error?: string;
            required_error?: string;
        } & {
            catch: T_1["_output"] | (() => T_1["_output"]);
        }

      Returns ZodCatch<T_1>

Accessors

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

Methods

  • Parameters

    Returns string

  • Parameters

    • refinement: ((arg, ctx) => any)
        • (arg, ctx): any
        • Parameters

          Returns any

    Returns ZodEffects<ZodCatch<T>, T["_output"], unknown>

  • Type Parameters

    • B extends string | number | symbol

    Parameters

    • Optional brand: B

    Returns ZodBranded<ZodCatch<T>, B>

  • Parameters

    • def: T["_output"]

    Returns ZodCatch<ZodCatch<T>>

  • Parameters

    • def: ((ctx) => T["_output"])
        • (ctx): T["_output"]
        • Parameters

          • ctx: {
                error: ZodError<any>;
                input: unknown;
            }

          Returns T["_output"]

    Returns ZodCatch<ZodCatch<T>>

  • Parameters

    • description: string

    Returns ZodCatch<T>

  • Returns boolean

  • Returns boolean

  • Parameters

    Returns T["_output"]

  • Parameters

    Returns Promise<T["_output"]>

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    Returns ZodEffects<ZodCatch<T>, RefinedOutput, unknown>

  • Parameters

    Returns ZodEffects<ZodCatch<T>, T["_output"], unknown>

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    • check: ((arg) => arg is RefinedOutput)
        • (arg): arg is RefinedOutput
        • Parameters

          • arg: T["_output"]

          Returns arg is RefinedOutput

    • refinementData: IssueData | ((arg, ctx) => IssueData)

    Returns ZodEffects<ZodCatch<T>, RefinedOutput, unknown>

  • Parameters

    • check: ((arg) => boolean)
        • (arg): boolean
        • Parameters

          • arg: T["_output"]

          Returns boolean

    • refinementData: IssueData | ((arg, ctx) => IssueData)

    Returns ZodEffects<ZodCatch<T>, T["_output"], unknown>

  • Returns T

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    • refinement: ((arg, ctx) => arg is RefinedOutput)
        • (arg, ctx): arg is RefinedOutput
        • Parameters

          Returns arg is RefinedOutput

    Returns ZodEffects<ZodCatch<T>, RefinedOutput, unknown>

  • Parameters

    • refinement: ((arg, ctx) => void)
        • (arg, ctx): void
        • Parameters

          Returns void

    Returns ZodEffects<ZodCatch<T>, T["_output"], unknown>

  • Type Parameters

    • NewOut

    Parameters

    • transform: ((arg, ctx) => NewOut | Promise<NewOut>)
        • (arg, ctx): NewOut | Promise<NewOut>
        • Parameters

          Returns NewOut | Promise<NewOut>

    Returns ZodEffects<ZodCatch<T>, NewOut, unknown>

Generated using TypeDoc