Skip to content

Instantly share code, notes, and snippets.

@popeating
Created November 3, 2023 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popeating/83673e4e57b54bb059c95d8717c47a55 to your computer and use it in GitHub Desktop.
Save popeating/83673e4e57b54bb059c95d8717c47a55 to your computer and use it in GitHub Desktop.
import * as z from 'zod';
const zSchema = z.object({
name: z
.string()
.min(3, { message: 'Name should have at least 3 characters' }),
email: z.string().email({ message: 'Email should be a valid address' }),
_id: z.string().optional(),
});
export default zSchema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment