Catch Type Errors at Runtime with Zod: An Intro to this JavaScript Library

Veröffentlicht am: 09 Januar 2023
auf dem Kanal: Swashbuckling with Code
5,082
203

Zod is a runtime type checking library for JavaScript that can help you catch type errors before they cause problems in your code. In this tutorial, you'll learn how to use Zod to define strict schemas for your data and ensure that your variables always have the correct type at runtime. By following best practices for type safety, you can write more reliable and maintainable code.

This tutorial covers the primary use case of Zod and some of the cool helper methods it has. By the end of the video, you'll have an understanding of how to start integrating it into your project and why it is growing in popularity.

🐱 Repository for code in the video:
https://github.com/Jimmydalecleveland...

~~~~~~

00:00 - What is Zod and why is it gaining popularity?
01:12 - Repo starting point quick walkthrough
02:51 - Standard ways to Type a fetch result
05:23 - Adding Zod to get runtime type checking
08:33 - Zod parsed results error output
10:03 - Fixing the error with Zod enforced actual fetch response
11:51 - Zod validation methods
15:08 - Transforming returned data with Zod
16:35 - Wrap-up and thoughts

~~~~~~

Follow Jimmy Cleveland's doings:
twitter:   / jimmydcleveland  
blog: https://blog.jimmydc.com/

#typescript #zod


Auf dieser Seite können Sie das Online-Video Catch Type Errors at Runtime with Zod: An Intro to this JavaScript Library mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Swashbuckling with Code 09 Januar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,082 Mal angesehen und es wurde von 203 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!