Type Safety with Zod & JSDoc in JavaScript

Type Safety and Runtime Validation in JavaScript with Zod and JSDoc Combining Zod's runtime validation with JSDoc's type annotations to achieve type safety in JavaScript without TypeScript. https://lnkd.in/deBkW-Gj #javascript

Another approach, which I borrowed from the world of data-oriented programming, is to type everything up with Zod, but only validate during local development (and not prod) due to obvious perf. concerns. I ended up publishing the following utility to that end: https://github.com/schalkventer/zod-dev

When Schalk posts and Schalk responds 🫡

  • No alternative text description for this image
See more comments

To view or add a comment, sign in

Explore content categories