Skip to content

Overview / getZodDefaults

getZodDefaults() ​

getZodDefaults<T>(schema, discriminant?): T["_output"] | undefined

Retrieves the default values for a given Zod schema.

Type Parameters ​

Type Parameter
T extends ZodTypeAny

Parameters ​

ParameterTypeDescription
schemaTThe Zod schema for which to retrieve the default values.
discriminant?stringThe discriminant value for discriminated unions.

Returns ​

T["_output"] | undefined

Released under the GPL-3.0 License.