UNPKG

@cdwr/core

Version:

A set of core utilities for the Codeware ecosystem.

22 lines (21 loc) 495 B
import { z } from 'zod'; declare const LiteralSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>; type Literal = z.infer<typeof LiteralSchema>; type Json = Literal | { [key: string]: Json; } | Json[]; /** * A schema for validating any JSON value * * @example * ```ts * try { * const * const value = JsonSchema.parse(data); * } catch (error) { * console.log('Invalid JSON data'); * } * ``` */ export declare const JsonSchema: z.ZodType<Json>; export {};