Creates a modified version of a Zod object schema where fields matching a predicate are made optional. Supports both Zod v3 and v4 schemas and preserves the original schema version.
interopZodObjectMakeFieldsOptional<
T extends InteropZodObject
>(schema: T, predicate: (key: string, value: InteropZodType) => boolean): InteropZodObject| Name | Type | Description |
|---|---|---|
schema* | T | The Zod object schema instance (either v3 or v4). |
predicate* | (key: string, value: InteropZodType) => boolean | Function to determine which fields should be optional. |