Documentation
    Preparing search index...

    Function flattenZodType

    • Convert a Zod schema expression into a concise string representation.

      • For known primitive calls (z.string(), z.number(), etc.), return the primitive name.
      • For z.literal(x), return the literal value as string.
      • Otherwise, generate the code snippet for the expression.

      Parameters

      • expr: Expression

        Babel Expression node for a Zod type

      Returns string

      String representation of the Zod type