Back to results
iamchanii/zod-class(opens in a new tab)
Language: TypeScript
- stars
- 4
- watchers
- 1
- forks
- 0
- open issues
- 0
- Last updated
- 05/23/2023
Language: TypeScript
This library was heavily inspired by the zod-class which made by @sam-goodwin. I took his implementation and just rewrote it into the code I needed for my purposes.
pnpm add @imchhh/zod-class
import { ZodClass } from '@imchhh/zod-class'; import { z } from 'zod'; declare const unknownInput: unknown; class User extends ZodClass({ name: z.string(), age: z.number(), }) {} const user = User.parse(unknownInput);
MIT