Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc