Use Prisma Enums in Runtime Validator

Can I use Prisma's generated enums in a zod runtime validator?

I have in the
@prisma/client
this:
export const Language: {
  EN: 'EN',
  SV: 'SV',
};

export type Language = (typeof Language)[keyof typeof Language]

the goal is to do something like
const LanguageValidator = z.enum(Language);

but the Language isn't a real object. is there any workarounds to do this?
Was this page helpful?