cctv

Type Safety and Runtime Safety Part.2/2: page, route guard & API

The post is divided into two parts. If you want to read part 1 first, please go to here. As part 1 is about runtime validation. Part 2 will focus on use cases. I will use Nuxt3 as example. Here I have 3 use cases: page, route guard (Vue route) and API. Prerequisite Basic knowledge: JavaScript, TypeScript, Nuxt3, Vue3, zod Case 1: Page Validation Suppose we have a post list page with route: /posts?...

Mar 17, 2024 Published · Oct 3, 2024 Updated · 7 min · Inori Inuyama