• Extends a Zod object schema with additional fields, supporting both Zod v3 and v4.

    Type Parameters

    Parameters

    • schema: T

      The Zod object schema instance (either v3 or v4).

    • extension: {} | {}

      The fields to add to the schema.

    Returns InteropZodObject

    The extended Zod object schema.

    If the schema is not a Zod v3 or v4 object.