prisma-zod-generator
Version:
Prisma 2+ generator to emit Zod schemas from your Prisma schema
19 lines (18 loc) • 975 B
TypeScript
/**
* Source for the `helpers/json-helpers.ts` file written into generated output.
*
* This module used to be a working implementation *and* the generator carried a second,
* hand-maintained copy of the same code as a template string in
* `Transformer.ensureJsonHelpersFile`. Only the template shipped; nothing imported this
* module. Two copies of one program, with nothing keeping them in step.
*
* It now follows the pattern `decimal-helpers.ts` already uses: one function returning the
* source text, called by the writer. The emitted result is type-checked by
* tests/generated-output-compiles.test.ts, whose fixture schema has a `Json` column, and its
* behaviour is pinned by tests/emitted-json-helpers.test.ts — so the copy users receive is
* the copy that is verified.
*
* `z` is assumed to be in scope: the caller prepends the zod import, whose binding style
* depends on zodImportTarget.
*/
export declare function generateJsonHelpers(): string;