Does superRefine() deprecated? or revived?
#5055
|
I saw that documents that superRefine was deprecated cause "check" replaced it. but now, document has been gone. Which way is correct? |
Replies: 1 comment
|
Hi @FourwingsY! I'm Dosu and I’m helping the zod team.
You can use either If this clears things up, feel free to close the issue! If you have more questions, let me know. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Hi @FourwingsY! I'm Dosu and I’m helping the zod team.
superRefine()was deprecated in Zod 4 for a while in favor of.check(), but this has changed: as of August 2025,superRefine()is no longer deprecated and is fully supported again. The deprecation notice was removed from both the codebase and the documentation (see PR #4954, current API docs).You can use either
.superRefine()(more user-friendly for most cases) or.check()(lower-level, more verbose, sometimes better for advanced or performance-sensitive scenarios). Both are valid for custom validation, and the docs now show examples for both.If this clears things up, feel free to close the issue! If you have more questions, let me…