https://github.com/iamchanii/zod-class
https://github.com/iamchanii/zod-class
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/iamchanii/zod-class
- Owner: iamchanii
- Created: 2023-05-19T00:49:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-23T07:53:59.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T13:05:40.991Z (12 days ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# zod-class
[](https://bundlephobia.com/result?p=@imchhh/zod-class)
## Acknowledgements
This library was heavily inspired by the [zod-class](https://github.com/sam-goodwin/zod-class) which made by **[@sam-goodwin](https://github.com/sam-goodwin)**. I took his implementation and just rewrote it into the code I needed for my purposes.
## Installation
```bash
pnpm add @imchhh/zod-class
```## Example
```ts
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);
```## License
MIT