Skip to content

Wegt-meoh/simple-zod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple zod

A simple implementation for zod library

Usage

import { z } from "./dist/index.js"

// test string schema
let stringSchema = z.string()
console.log(stringSchema.parse("sdfsdf"))
try {
    stringSchema.parse(11) // expect throws an error
} catch (error) {
    console.error("carch error:", error.message)
}

// more detail see index.test.js

Feature

z.number()
z.string()
z.boolean()
z.null()
z.array()
z.object()
z.union()
z.enum()
z.infer<typeof z.number()>

build

pnpm build

test

pnpm test

About

A simple implement for zod library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors