Skip to content

Commit

Permalink
🧼 format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
m1212e committed Nov 18, 2024
1 parent b1546cb commit e31bef9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const configSchema = Type.Object(
*/
exportedTypePrefix: Type.String({ default: "" }),
},
{ additionalProperties: false }
{ additionalProperties: false },
);

// biome-ignore lint/suspicious/noExplicitAny: we want to set the default value
Expand Down
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
18 changes: 9 additions & 9 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ import {
processedRelationsInputUpdate,
} from "./generators/relations";
import { processedSelect } from "./generators/select";
import { processedWhere, processedWhereUnique } from "./generators/where";
import { makeComposite } from "./generators/wrappers/composite";
import { nullableImport, nullableType } from "./generators/wrappers/nullable";
import {
transformDateType,
transformDateImportStatement,
transformDateType,
} from "./generators/transformDate";
import { processedWhere, processedWhereUnique } from "./generators/where";
import { makeComposite } from "./generators/wrappers/composite";
import { nullableImport, nullableType } from "./generators/wrappers/nullable";

export type ProcessedModel = {
name: string;
stringRepresentation: string;
};

function convertModelToStandalone(
input: Pick<ProcessedModel, "name" | "stringRepresentation">
input: Pick<ProcessedModel, "name" | "stringRepresentation">,
) {
return `export const ${getConfig().exportedTypePrefix}${input.name} = ${input.stringRepresentation}\n`;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ export function mapAllModelsForWrite() {
`${value}\n${convertModelToStandalone({
name: key,
stringRepresentation: composite,
})}`
})}`,
);
}

Expand All @@ -106,7 +106,7 @@ export function mapAllModelsForWrite() {
`${value}\n${convertModelToStandalone({
name: `${key}InputCreate`,
stringRepresentation: composite,
})}`
})}`,
);
}
}
Expand All @@ -124,15 +124,15 @@ export function mapAllModelsForWrite() {
`${value}\n${convertModelToStandalone({
name: `${key}InputUpdate`,
stringRepresentation: composite,
})}`
})}`,
);
}
}

for (const [key, value] of modelsPerName) {
modelsPerName.set(
key,
`${typepoxImportStatement()}\n${transformDateImportStatement()}\n${nullableImport()}\n${value}`
`${typepoxImportStatement()}\n${transformDateImportStatement()}\n${nullableImport()}\n${value}`,
);
}

Expand Down

0 comments on commit e31bef9

Please sign in to comment.