🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

zonk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zonk

<sup>Because Zod + Stronk = Zonk 💪</sup>

0.1.0
latest
Source
npm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

zonk

Because Zod + Stronk = Zonk 💪

Usage

Zonk creates strongly typed strongly opinionated objects and arrays from your existing Zod-schemas.

Importing zonk extends your Zod object- and array schemas with the .zonk() method, which you can call with a valid input. You then receive a proxy that validates any changes to its children, ie. any mutation causes the schema to validate itself and its children.

Example

import { z } from "zod";
import "zonk";

const zSchema = z.object({ arr: z.array(z.number()) });

const value = zSchema.zonk({ arr: [1, 2, 3] });

value.arr.push("This will throw an error 💥" as any);

Plans

This was just an intrusive thought that needed to be toyed with for a couple of hours. I have no idea if it will go any further than that.

FAQs

Package last updated on 17 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