@declaro/zod
v2.0.0-beta.127
Published
A library for Zod-based models in the Declaro ecosystem.
Readme
@declaro/zod
A library for Zod-based models in the Declaro ecosystem.
Installation
# Using bun
bun add @declaro/zod
# Using npm
npm install @declaro/zod
# Using yarn
yarn add @declaro/zodUsage
import { ZodModel } from '@declaro/zod'
import { z } from 'zod'
const userModel = new ZodModel(
'User',
z.object({
name: z.string(),
age: z.number(),
}),
)
const result = await userModel.validate({ name: 'Alice', age: 30 })
console.log(result)License
MIT
