Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/core/utils/database.utils.ts>createZod

Deno-powered framework for building business web apps
Go to Latest
variable createZod
import { createZod } from "https://deno.land/x/netzo@0.3.91/core/utils/database.utils.ts";

Creates a Zod schema from a JSON schema (string or object).

Examples

const accountJsonSchema = { type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, }, "required": ["id", "name"] } export const accountSchemaString = jsonSchemaToZod(accountJsonSchema); export const accountSchema = createZodSchema(accountSchemaString); export type Account = z.infer;

type

(schema: string | object) => unknown