mutano 3.1.0 → 3.1.2

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 +7 -0
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -384,6 +384,9 @@ function generateStandardType(op, desc, config, destination, typeMappings) {
384
384
  } else if (typeMappings.decimalTypes.includes(type)) {
385
385
  if (isZodDestination) {
386
386
  baseType = "z.string()";
387
+ if (op !== "selectable") {
388
+ baseType += ".trim().min(1)";
389
+ }
387
390
  } else if (isKyselyDestination) {
388
391
  baseType = "Decimal";
389
392
  } else {
@@ -710,6 +713,10 @@ function generateZodContent({
710
713
  content += `export const insertable_${snakeTable} = z.object({
711
714
  `;
712
715
  for (const desc of describes) {
716
+ const isAutoGeneratedDatetime = isAutoGeneratedDateTimeField(desc, config.origin.type);
717
+ if (isAutoGeneratedDatetime) {
718
+ continue;
719
+ }
713
720
  const fieldName = isCamelCase ? camelCase(desc.Field) : desc.Field;
714
721
  const fieldType = getType("insertable", desc, config, destination);
715
722
  content += ` ${fieldName}: ${fieldType},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mutano",
3
3
  "type": "module",
4
- "version": "3.1.0",
4
+ "version": "3.1.2",
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",