One strategy for custom validation is using the Zod transform method to manipulate and validate an entry and customize the error message.
It's easy to use z.infer to get the output type of a Zod validator. But what if you have a generic validator that depends on another type?
Zod is a validation library that allows you to define schemas in code. It’s a plus to have autocomplete built-in.
If you want peace of mind for all of your data, I highly recommend integrating Zod (or another schema validation library) into your project.