mutano 3.2.0 → 3.2.1

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.
Files changed (2) hide show
  1. package/dist/main.js +19 -1
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -913,7 +913,24 @@ function extractPrismaEntities(config) {
913
913
  if (prismaEnum && "name" in prismaEnum && "enumerators" in prismaEnum) {
914
914
  const enumName = prismaEnum.name;
915
915
  const enumerators = prismaEnum.enumerators;
916
- enumDeclarations[enumName] = enumerators.map((e) => {
916
+ const hasEnumIgnore = enumerators.some(
917
+ (item) => item.type === "attribute" && item.name === "ignore" && item.kind === "object"
918
+ );
919
+ if (hasEnumIgnore) {
920
+ continue;
921
+ }
922
+ const filteredEnumValues = enumerators.filter((e) => {
923
+ if (e.type === "attribute") {
924
+ return false;
925
+ }
926
+ if ("attributes" in e && e.attributes) {
927
+ const hasIgnore = e.attributes.some((attr) => attr.name === "ignore");
928
+ if (hasIgnore) {
929
+ return false;
930
+ }
931
+ }
932
+ return true;
933
+ }).map((e) => {
917
934
  if ("attributes" in e && e.attributes) {
918
935
  const mapAttr = e.attributes.find((attr) => attr.name === "map");
919
936
  if (mapAttr && mapAttr.args && mapAttr.args.length > 0) {
@@ -931,6 +948,7 @@ function extractPrismaEntities(config) {
931
948
  }
932
949
  return e.name;
933
950
  });
951
+ enumDeclarations[enumName] = filteredEnumValues;
934
952
  }
935
953
  }
936
954
  return { tables, views, enumDeclarations };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mutano",
3
3
  "type": "module",
4
- "version": "3.2.0",
4
+ "version": "3.2.1",
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",