Returns a strict version of a Zod object schema, disallowing unknown keys. Supports both Zod v3 and v4 object schemas. If recursive is true, applies strictness recursively to all nested object schemas and arrays of object schemas.
recursive
The type of the Zod object schema.
The Zod object schema instance (either v3 or v4).
Optional
Whether to apply strictness recursively to nested objects/arrays.
The strict Zod object schema.
If the schema is not a Zod v3 or v4 object.
Returns a strict version of a Zod object schema, disallowing unknown keys. Supports both Zod v3 and v4 object schemas. If
recursive
is true, applies strictness recursively to all nested object schemas and arrays of object schemas.