Skip to content

Commit

Permalink
fix: correct types to allow readonly from DMMF
Browse files Browse the repository at this point in the history
Closes #86 and #89
  • Loading branch information
Ovyerus committed Feb 27, 2024
1 parent 13db9ab commit 74cac7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/prismaToFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ const generateNodes = (
return nodes;
};

const generateEnumNodes = (enums: DMMF.DatamodelEnum[]): EnumNodeData[] =>
const generateEnumNodes = (
enums: readonly DMMF.DatamodelEnum[],
): EnumNodeData[] =>
enums.map(({ name, dbName, documentation, values }) => ({
type: "enum",
name,
Expand All @@ -287,7 +289,7 @@ const generateEnumNodes = (enums: DMMF.DatamodelEnum[]): EnumNodeData[] =>
}));

const generateModelNodes = (
models: DMMF.Model[],
models: readonly DMMF.Model[],
relations: Record<string, GotModelRelations>,
): ModelNodeData[] =>
models.map(({ name, dbName, documentation, fields }) => {
Expand Down

0 comments on commit 74cac7c

Please sign in to comment.