mutano 2.6.6 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +2 -6
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -506,9 +506,7 @@ export type ${camelCase(table, { pascalCase: true })} = {`;
|
|
|
506
506
|
`;
|
|
507
507
|
} else if (destination.type === "zod") {
|
|
508
508
|
const header = destination.header;
|
|
509
|
-
content = header ?
|
|
510
|
-
|
|
511
|
-
` : defaultZodHeader2(destination.version || 3);
|
|
509
|
+
content = header ? header + "\n\n" : defaultZodHeader2(destination.version || 3);
|
|
512
510
|
content += `export const ${table} = z.object({`;
|
|
513
511
|
for (const desc of describes) {
|
|
514
512
|
const field = isCamelCase ? camelCase(desc.Field) : desc.Field;
|
|
@@ -574,9 +572,7 @@ export type Selectable${camelCase(`${table}Type`, {
|
|
|
574
572
|
return content;
|
|
575
573
|
}
|
|
576
574
|
const defaultKyselyHeader = "import { ColumnType, Selectable, Insertable, Updateable } from 'kysely';\n\n";
|
|
577
|
-
const defaultZodHeader = (version) =>
|
|
578
|
-
|
|
579
|
-
`;
|
|
575
|
+
const defaultZodHeader = (version) => "import { z } from 'zod" + (version === 3 ? "" : "/v4") + "';\n\n";
|
|
580
576
|
async function generate(config) {
|
|
581
577
|
let tables = [];
|
|
582
578
|
let prismaTables = [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mutano",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.7",
|
|
5
5
|
"description": "Converts Prisma/MySQL/PostgreSQL/SQLite schemas to Zod/TS/Kysely interfaces",
|
|
6
6
|
"author": "Alisson Cavalcante Agiani <thelinuxlich@gmail.com>",
|
|
7
7
|
"license": "MIT",
|