• Returns a getter function for the default value of a Zod schema, if one is defined. Supports both Zod v3 and v4 schemas. If the schema has a default value, the returned function will return that value when called. If no default is defined, returns undefined.

    Type Parameters

    Parameters

    • schema: T

      The Zod schema instance (either v3 or v4).

    Returns (() => InferInteropZodOutput<T>) | undefined

    A function that returns the default value, or undefined if no default is set.