mutano 3.1.2 → 3.1.4

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 +5 -2
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -385,7 +385,10 @@ function generateStandardType(op, desc, config, destination, typeMappings) {
385
385
  if (isZodDestination) {
386
386
  baseType = "z.string()";
387
387
  if (op !== "selectable") {
388
- baseType += ".trim().min(1)";
388
+ baseType += ".trim()";
389
+ if (!hasDefaultValue) {
390
+ baseType += ".min(1)";
391
+ }
389
392
  }
390
393
  } else if (isKyselyDestination) {
391
394
  baseType = "Decimal";
@@ -415,7 +418,7 @@ function generateStandardType(op, desc, config, destination, typeMappings) {
415
418
  const requiredString = destination.requiredString;
416
419
  baseType = "z.string()";
417
420
  if (useTrim && op !== "selectable") baseType += ".trim()";
418
- if (requiredString && !shouldBeNullable && op !== "selectable" && !(op === "updateable" && hasDefaultValue)) baseType += ".min(1)";
421
+ if (requiredString && !shouldBeNullable && op !== "selectable" && !hasDefaultValue) baseType += ".min(1)";
419
422
  } else {
420
423
  baseType = "string";
421
424
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mutano",
3
3
  "type": "module",
4
- "version": "3.1.2",
4
+ "version": "3.1.4",
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",