Union zod type consoling issues
I have tried some methods and ways to make an input optional, so i can pass or not.
I had created a schema for my server action like this:
```javascript
z.union([
z.object({ ... }),
z.void(),
]).optional()
```
And when i doesn't pass a object, the function works normally but debugs on console an issue, and the same happens when i pass a object.
In other words, regardless of what I pass, because it is a `z.union`, the function will pass the input and work normally, but, the issues in my schemas will be debugged in the console.

关闭于 2025-02-20 0 条评论