vowwch
v0.1.0
Published
Zero-dependency runtime contracts for any JavaScript function.
Readme
vowwch
Zero-dependency runtime contracts for any JavaScript function.
import { contract } from "vowwch"
const double = contract((n: number) => n * 2, {
name: "double",
input: (v: unknown): v is number => typeof v === "number",
mode: "strict",
})
double(5) // 10
double("bad" as any) // throws VowwchViolationError- Zero dependencies — No transitive supply chain risk
- Single-file vendorable —
curlit into your project and own the source - Predicate-based —
(value: unknown) => value is T— no schema DSL to learn - Three modes —
strict(throw),warn(log),silent(zero cost)
Install
npm install vowwchDocs
Full documentation at vowwch.vercel.app
License
MIT
