@lambda-func/zod
npm i @lambda-func/zod
This package contains a middleware to use zod for type parsing.
Usage
import { z } from 'zod'
import { zodParser } from '@lambda-func/zod'
const Request = z.object({
name: z.string()
})
// will throw an error if not value Request
export const handler = zodParser(Request)(async (event) => {
return event.name
})