@imchhh/zod-class
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

zod-class

Acknowledgements

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.

Installation

pnpm add @imchhh/zod-class

Example

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

Readme

Keywords

none

Package Sidebar

Install

npm i @imchhh/zod-class

Weekly Downloads

2

Version

0.0.7

License

none

Unpacked Size

4.18 kB

Total Files

6

Last publish

Collaborators

  • imch