mutano 1.0.7 → 1.0.8
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 +5 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -95,7 +95,7 @@ function getType(op, desc, config) {
|
|
|
95
95
|
const field = typeOverride ? [typeOverride] : dateField;
|
|
96
96
|
if (isNull && !typeOverride)
|
|
97
97
|
field.push(nullable);
|
|
98
|
-
else if (hasDefaultValue)
|
|
98
|
+
else if (hasDefaultValue || !hasDefaultValue && isGenerated)
|
|
99
99
|
field.push(optional);
|
|
100
100
|
if (hasDefaultValue && !isGenerated)
|
|
101
101
|
field.push(`default('${Default}')`);
|
|
@@ -107,7 +107,7 @@ function getType(op, desc, config) {
|
|
|
107
107
|
const field = typeOverride ? [typeOverride] : string;
|
|
108
108
|
if (isNull && !typeOverride)
|
|
109
109
|
field.push(nullable);
|
|
110
|
-
else if (hasDefaultValue)
|
|
110
|
+
else if (hasDefaultValue || !hasDefaultValue && isGenerated)
|
|
111
111
|
field.push(optional);
|
|
112
112
|
else if (isRequiredString && !typeOverride)
|
|
113
113
|
field.push(min1);
|
|
@@ -121,7 +121,7 @@ function getType(op, desc, config) {
|
|
|
121
121
|
const field = typeOverride ? [typeOverride] : boolean;
|
|
122
122
|
if (isNull && !typeOverride)
|
|
123
123
|
field.push(nullable);
|
|
124
|
-
else if (hasDefaultValue)
|
|
124
|
+
else if (hasDefaultValue || !hasDefaultValue && isGenerated)
|
|
125
125
|
field.push(optional);
|
|
126
126
|
if (hasDefaultValue && !isGenerated)
|
|
127
127
|
field.push(`default(${Boolean(+Default)})`);
|
|
@@ -136,7 +136,7 @@ function getType(op, desc, config) {
|
|
|
136
136
|
field.push(nonnegative);
|
|
137
137
|
if (isNull && !typeOverride)
|
|
138
138
|
field.push(nullable);
|
|
139
|
-
else if (hasDefaultValue)
|
|
139
|
+
else if (hasDefaultValue || !hasDefaultValue && isGenerated)
|
|
140
140
|
field.push(optional);
|
|
141
141
|
if (hasDefaultValue && !isGenerated)
|
|
142
142
|
field.push(`default(${Default})`);
|
|
@@ -149,7 +149,7 @@ function getType(op, desc, config) {
|
|
|
149
149
|
const field = [`z.enum([${value}])`];
|
|
150
150
|
if (isNull)
|
|
151
151
|
field.push(nullable);
|
|
152
|
-
else if (hasDefaultValue)
|
|
152
|
+
else if (hasDefaultValue || !hasDefaultValue && isGenerated)
|
|
153
153
|
field.push(optional);
|
|
154
154
|
if (hasDefaultValue && !isGenerated)
|
|
155
155
|
field.push(`default('${Default}')`);
|
package/package.json
CHANGED