1
2
3
4
5
6
7
8
9
import { z } from "npm:zod@3.21.4";
export const UserSchema = z.object({
username: z.string().min(3).max(20),
email: z.string().email(),
age: z.number().int().positive().max(120),
});
export type User = z.infer<typeof UserSchema>;
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
August 23, 2024