@stryke/prisma-trpc-generator
Version:
A fork of the prisma-trpc-generator code to work in ESM with Prisma v6.
17 lines (16 loc) • 541 B
JavaScript
//#region src/zod/whereUniqueInput-helpers.ts
function changeOptionalToRequiredFields(inputObjectTypes) {
inputObjectTypes.map((item) => {
if (item.name.includes("WhereUniqueInput") && item.constraints.fields?.length > 0) item.fields = item.fields.map((subItem) => {
if (item.constraints.fields?.includes(subItem.name)) {
subItem.isRequired = true;
return subItem;
}
return subItem;
});
return item;
});
}
//#endregion
export { changeOptionalToRequiredFields };
//# sourceMappingURL=whereUniqueInput-helpers.mjs.map