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.
@@ -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-XTNCGTDO.mjs.map
7846
+ //# sourceMappingURL=chunk-L4KELCY7.mjs.map