Skip to content

Commit

Permalink
🐞 fix: dont include additional fields on input types
Browse files Browse the repository at this point in the history
  • Loading branch information
m1212e committed Jul 22, 2024
1 parent 01cf6a6 commit 5767fe7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/generators/plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ export function stringifyPlain(data: DMMF.Model, isInputModel = false) {

return `${getConfig().typeboxImportVariableName}.Object({${[
...fields,
getConfig().additionalFieldsPlain ?? [],
!isInputModel ? getConfig().additionalFieldsPlain ?? [] : [],
].join(",")}},${generateTypeboxOptions(annotations)})\n`;
}
2 changes: 1 addition & 1 deletion src/generators/primitiveField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const PrimitiveFields = [
export type PrimitivePrismaFieldType = (typeof PrimitiveFields)[number];

export function isPrimitivePrismaFieldType(
str: string
str: string,
): str is PrimitivePrismaFieldType {
// biome-ignore lint/suspicious/noExplicitAny: we want to check if the string is a valid primitive field
return PrimitiveFields.includes(str as any);
Expand Down

0 comments on commit 5767fe7

Please sign in to comment.