sonamu 0.2.53 → 0.2.54
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/bin/cli.js +48 -48
- package/dist/bin/cli.mjs +1 -1
- package/dist/{chunk-5UCV2JP3.js → chunk-JOHF7PK4.js} +14 -1
- package/dist/chunk-JOHF7PK4.js.map +1 -0
- package/dist/{chunk-XTNCGTDO.mjs → chunk-L4KELCY7.mjs} +14 -1
- package/dist/chunk-L4KELCY7.mjs.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/api/code-converters.ts +19 -0
- package/dist/chunk-5UCV2JP3.js.map +0 -1
- package/dist/chunk-XTNCGTDO.mjs.map +0 -1
|
@@ -354,6 +354,19 @@ function getZodTypeFromApiParamType(paramType, references) {
|
|
|
354
354
|
return reference;
|
|
355
355
|
case "union":
|
|
356
356
|
const unionType = paramType;
|
|
357
|
+
if (unionType.types.length === 2 && unionType.types.some((type) => type === "null")) {
|
|
358
|
+
if (unionType.types[0] === "null") {
|
|
359
|
+
return getZodTypeFromApiParamType(
|
|
360
|
+
unionType.types[1],
|
|
361
|
+
references
|
|
362
|
+
).nullable();
|
|
363
|
+
} else {
|
|
364
|
+
return getZodTypeFromApiParamType(
|
|
365
|
+
unionType.types[0],
|
|
366
|
+
references
|
|
367
|
+
).nullable();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
357
370
|
return z2.union(
|
|
358
371
|
unionType.types.map(
|
|
359
372
|
(type) => getZodTypeFromApiParamType(type, references)
|
|
@@ -7830,4 +7843,4 @@ export {
|
|
|
7830
7843
|
FixtureManagerClass,
|
|
7831
7844
|
FixtureManager
|
|
7832
7845
|
};
|
|
7833
|
-
//# sourceMappingURL=chunk-
|
|
7846
|
+
//# sourceMappingURL=chunk-L4KELCY7.mjs.map
|