About any in source code
#5092
Replies: 1 comment 2 replies
-
|
Hi @ShionTerunaga! I'm Dosu and I’m helping the zod team. I'm a bot trained on Zod's codebase and issues. The use of If your use case allows for stricter runtime checks, your proposed change is reasonable for your own code, but be aware it could restrict some advanced usage patterns that Zod supports by design. For best practices, avoid If this answers your question, please close the issue! To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Note
It's just a question I have.
Target source code
packages/zod/src/v4/core/registries.tsBackground
I try not to use
anyas much as possible in my daily work because it compromises security.While reading this source code to improve my skills, I noticed that
anywas defined in the above source code and thought that it might be possible to perform type guarding at runtime.One proposal
For example, I thought that it could be converted to the above source code.
Removing
anyadds one more condition, but I personally thought that this would be fine.Is it okay to change the above source code?
Beta Was this translation helpful? Give feedback.
All reactions