Auto throw if invalid

I have been looking through the docs and the API manually, but I haven't found something elegant that I am looking for.

Is there a way to strictly throw an error if the validation doesn't pass? While I don't normally mind the explicitness of instanceof type.errors, I kinda prefer the method opt-in from Zod (parse vs safeParse) to make that choice. To be clear this would purely be a DX improvement to prevent typing out the error catching manually for type inference.
Was this page helpful?