PodRocket cover image

Zod with Matt Pocock

PodRocket

00:00

Can You Do Async Transformations?

Zod is a JavaScript library that allows you to transform input into output. You can do this with transforms and even as part of an 'async' function. So could we use this for like a password validation? You need to have 20 characters one and cap and one explanation. Yeah totally like custom errors would work totally fine. I'm trying to think you could yeah like with one capital with you could even do itAsync refinements are kind of cool as well because with an async refinement you could call an external API that says is this password okay if it's not okay then throw an error.

Play episode from 13:32
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app