UNPKG

prisma-zod-generator

Version:

Prisma 2+ generator to emit Zod schemas from your Prisma schema

19 lines (18 loc) 1.13 kB
import { z } from 'zod'; export type JsonPrimitive = string | number | boolean | null; export type JsonValue = JsonPrimitive | JsonValue[] | { [k: string]: JsonValue; }; export type InputJsonValue = Exclude<JsonPrimitive, null> | Array<InputJsonValue | null> | { [k: string]: InputJsonValue | null; }; export type NullableJsonInput = JsonValue | 'JsonNull' | 'DbNull' | null; export declare const transformJsonNull: (v?: NullableJsonInput) => JsonValue; export declare const JsonValueSchema: z.ZodType<JsonValue>; export type JsonValueType = z.infer<typeof JsonValueSchema>; export declare const InputJsonValueSchema: z.ZodType<InputJsonValue>; export type InputJsonValueType = z.infer<typeof InputJsonValueSchema>; export declare const NullableJsonValue: z.ZodPipe<z.ZodUnion<readonly [z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>, z.ZodLiteral<"DbNull">, z.ZodLiteral<"JsonNull">, z.ZodLiteral<null>]>, z.ZodTransform<string | number | boolean | JsonValue[] | { [k: string]: JsonValue; } | null, JsonValue>>; export type NullableJsonValueType = z.infer<typeof NullableJsonValue>;