@optique/zod 1.0.0-dev.465 → 1.0.0-dev.467

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/index.cjs CHANGED
@@ -78,8 +78,16 @@ function inferMetavar(schema) {
78
78
  if (typeName === "ZodDate" || typeName === "date") return "DATE";
79
79
  if (typeName === "ZodEnum" || typeName === "enum" || typeName === "ZodNativeEnum" || typeName === "nativeEnum") return "CHOICE";
80
80
  if (typeName === "ZodUnion" || typeName === "union" || typeName === "ZodLiteral" || typeName === "literal") return "VALUE";
81
- if (typeName === "ZodOptional" || typeName === "optional" || typeName === "ZodNullable" || typeName === "nullable") return inferMetavar(def.innerType);
82
- if (typeName === "ZodDefault" || typeName === "default") return inferMetavar(def.innerType);
81
+ if (typeName === "ZodOptional" || typeName === "optional" || typeName === "ZodNullable" || typeName === "nullable") {
82
+ const innerType = def.innerType;
83
+ if (innerType != null) return inferMetavar(innerType);
84
+ return "VALUE";
85
+ }
86
+ if (typeName === "ZodDefault" || typeName === "default") {
87
+ const innerType = def.innerType;
88
+ if (innerType != null) return inferMetavar(innerType);
89
+ return "VALUE";
90
+ }
83
91
  return "VALUE";
84
92
  }
85
93
  /**
package/dist/index.js CHANGED
@@ -55,8 +55,16 @@ function inferMetavar(schema) {
55
55
  if (typeName === "ZodDate" || typeName === "date") return "DATE";
56
56
  if (typeName === "ZodEnum" || typeName === "enum" || typeName === "ZodNativeEnum" || typeName === "nativeEnum") return "CHOICE";
57
57
  if (typeName === "ZodUnion" || typeName === "union" || typeName === "ZodLiteral" || typeName === "literal") return "VALUE";
58
- if (typeName === "ZodOptional" || typeName === "optional" || typeName === "ZodNullable" || typeName === "nullable") return inferMetavar(def.innerType);
59
- if (typeName === "ZodDefault" || typeName === "default") return inferMetavar(def.innerType);
58
+ if (typeName === "ZodOptional" || typeName === "optional" || typeName === "ZodNullable" || typeName === "nullable") {
59
+ const innerType = def.innerType;
60
+ if (innerType != null) return inferMetavar(innerType);
61
+ return "VALUE";
62
+ }
63
+ if (typeName === "ZodDefault" || typeName === "default") {
64
+ const innerType = def.innerType;
65
+ if (innerType != null) return inferMetavar(innerType);
66
+ return "VALUE";
67
+ }
60
68
  return "VALUE";
61
69
  }
62
70
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/zod",
3
- "version": "1.0.0-dev.465+097d1ac4",
3
+ "version": "1.0.0-dev.467+6cd2594b",
4
4
  "description": "Zod value parsers for Optique",
5
5
  "keywords": [
6
6
  "CLI",
@@ -57,7 +57,7 @@
57
57
  "zod": "^3.25.0 || ^4.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@optique/core": "1.0.0-dev.465+097d1ac4"
60
+ "@optique/core": "1.0.0-dev.467+6cd2594b"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "^20.19.9",