Yukaii / zuzugo

租租狗,通通給我租起來!
https://zuzugo.vercel.app
MIT License
11 stars 4 forks source link

Replace lib/types.ts typing with Zod inferred type #71

Closed Yukaii closed 1 year ago

Yukaii commented 1 year ago

https://zod.dev/?id=basic-usage

const User = z.object({
  username: z.string(),
});

User.parse({ username: "Ludwig" });

// extract the inferred type
type User = z.infer<typeof User>;
// { username: string }