Skip to content

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 ​

CanonicalType

create ​

boolean

Returns ​

string

Released under the MIT License.