basalt / ai/src / zodValidator
Function: zodValidator()
> zodValidator(t, create): string
Defined in: ai/src/make/fields.ts:46
Zod validator for a field. On input (create) a DateTime coerces from a date/ISO string to a Date (so Prisma accepts it — a bare z.string() lets a non-ISO value like "1990-05-01" through to Prisma and 500). On output it's an ISO string, matching the mapper.
Parameters
t
create
boolean
Returns
string