You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@imchhh/zod-class

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imchhh/zod-class

[![](https://badgen.net/bundlephobia/minzip/@imchhh/zod-class)](https://bundlephobia.com/result?p=@imchhh/zod-class) ![](https://badgen.net/npm/types/@imchhh/zod-class)

0.0.7
latest
npmnpm
Version published
Weekly downloads
2
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 23 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts