fullstacked 0.12.0-1272 → 0.12.0-1290

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 (165) hide show
  1. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +20 -2
  2. package/fullstacked_modules/@fullstacked/ai-agent/lock.json +469 -38
  3. package/fullstacked_modules/@fullstacked/ai-agent/package.json +11 -1
  4. package/fullstacked_modules/@fullstacked/ai-agent/src/conversation.ts +72 -14
  5. package/fullstacked_modules/@fullstacked/ai-agent/src/index.ts +1 -2
  6. package/fullstacked_modules/@fullstacked/ai-agent/src/markdown.ts +8 -4
  7. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/anthropic.ts +46 -0
  8. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/deepseek.ts +46 -0
  9. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/google.ts +40 -0
  10. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/index.ts +41 -0
  11. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/interface.ts +19 -0
  12. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/mistral.ts +47 -0
  13. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +26 -9
  14. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/openai.ts +21 -9
  15. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/xai.ts +43 -0
  16. package/fullstacked_modules/@fullstacked/ai-agent/summary.txt +7 -0
  17. package/fullstacked_modules/ai/index.js +155662 -87448
  18. package/fullstacked_modules/esbuild/sass.ts +1 -1
  19. package/fullstacked_modules/fetch/index.ts +1 -4
  20. package/fullstacked_modules/sass/index.js +3 -3
  21. package/fullstacked_modules/zod/README.md +3 -3
  22. package/fullstacked_modules/zod/index.d.cts +2 -2
  23. package/fullstacked_modules/zod/index.d.ts +2 -2
  24. package/fullstacked_modules/zod/package.json +10 -26
  25. package/fullstacked_modules/zod/src/index.ts +2 -2
  26. package/fullstacked_modules/zod/src/v3/tests/string.test.ts +2 -2
  27. package/fullstacked_modules/zod/src/v3/types.ts +1 -3
  28. package/fullstacked_modules/zod/src/v4/classic/checks.ts +0 -1
  29. package/fullstacked_modules/zod/src/v4/classic/compat.ts +0 -4
  30. package/fullstacked_modules/zod/src/v4/classic/errors.ts +2 -9
  31. package/fullstacked_modules/zod/src/v4/classic/schemas.ts +47 -24
  32. package/fullstacked_modules/zod/src/v4/classic/tests/catch.test.ts +5 -4
  33. package/fullstacked_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -6
  34. package/fullstacked_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -42
  35. package/fullstacked_modules/zod/src/v4/classic/tests/error-utils.test.ts +2 -70
  36. package/fullstacked_modules/zod/src/v4/classic/tests/file.test.ts +2 -5
  37. package/fullstacked_modules/zod/src/v4/classic/tests/literal.test.ts +0 -25
  38. package/fullstacked_modules/zod/src/v4/classic/tests/number.test.ts +0 -23
  39. package/fullstacked_modules/zod/src/v4/classic/tests/optional.test.ts +0 -13
  40. package/fullstacked_modules/zod/src/v4/classic/tests/partial.test.ts +0 -193
  41. package/fullstacked_modules/zod/src/v4/classic/tests/pickomit.test.ts +5 -5
  42. package/fullstacked_modules/zod/src/v4/classic/tests/preprocess.test.ts +15 -4
  43. package/fullstacked_modules/zod/src/v4/classic/tests/record.test.ts +1 -15
  44. package/fullstacked_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -121
  45. package/fullstacked_modules/zod/src/v4/classic/tests/string.test.ts +4 -119
  46. package/fullstacked_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -3
  47. package/fullstacked_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -27
  48. package/fullstacked_modules/zod/src/v4/classic/tests/transform.test.ts +0 -104
  49. package/fullstacked_modules/zod/src/v4/classic/tests/tuple.test.ts +2 -2
  50. package/fullstacked_modules/zod/src/v4/classic/tests/union.test.ts +3 -90
  51. package/fullstacked_modules/zod/src/v4/core/api.ts +96 -130
  52. package/fullstacked_modules/zod/src/v4/core/checks.ts +2 -4
  53. package/fullstacked_modules/zod/src/v4/core/doc.ts +2 -2
  54. package/fullstacked_modules/zod/src/v4/core/errors.ts +44 -43
  55. package/fullstacked_modules/zod/src/v4/core/json-schema.ts +3 -6
  56. package/fullstacked_modules/zod/src/v4/core/regexes.ts +6 -9
  57. package/fullstacked_modules/zod/src/v4/core/registries.ts +2 -3
  58. package/fullstacked_modules/zod/src/v4/core/schemas.ts +107 -165
  59. package/fullstacked_modules/zod/src/v4/core/to-json-schema.ts +11 -38
  60. package/fullstacked_modules/zod/src/v4/core/util.ts +105 -157
  61. package/fullstacked_modules/zod/src/v4/core/versions.ts +1 -1
  62. package/fullstacked_modules/zod/src/v4/locales/index.ts +0 -3
  63. package/fullstacked_modules/zod/src/v4/mini/schemas.ts +1 -14
  64. package/fullstacked_modules/zod/src/v4/mini/tests/assignability.test.ts +1 -1
  65. package/fullstacked_modules/zod/src/v4/mini/tests/computed.test.ts +1 -1
  66. package/fullstacked_modules/zod/src/v4/mini/tests/error.test.ts +1 -1
  67. package/fullstacked_modules/zod/src/v4/mini/tests/index.test.ts +1 -1
  68. package/fullstacked_modules/zod/src/v4/mini/tests/number.test.ts +1 -1
  69. package/fullstacked_modules/zod/src/v4/mini/tests/object.test.ts +1 -1
  70. package/fullstacked_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
  71. package/fullstacked_modules/zod/src/v4/mini/tests/recursive-types.test.ts +1 -1
  72. package/fullstacked_modules/zod/src/v4/mini/tests/string.test.ts +1 -1
  73. package/fullstacked_modules/zod/v3/ZodError.d.cts +6 -6
  74. package/fullstacked_modules/zod/v3/ZodError.d.ts +6 -6
  75. package/fullstacked_modules/zod/v3/locales/en.d.cts +1 -1
  76. package/fullstacked_modules/zod/v3/types.d.cts +1 -4
  77. package/fullstacked_modules/zod/v3/types.d.ts +1 -4
  78. package/fullstacked_modules/zod/v4/classic/checks.d.cts +1 -1
  79. package/fullstacked_modules/zod/v4/classic/checks.d.ts +1 -1
  80. package/fullstacked_modules/zod/v4/classic/compat.d.cts +0 -4
  81. package/fullstacked_modules/zod/v4/classic/compat.d.ts +0 -4
  82. package/fullstacked_modules/zod/v4/classic/schemas.d.cts +20 -9
  83. package/fullstacked_modules/zod/v4/classic/schemas.d.ts +20 -9
  84. package/fullstacked_modules/zod/v4/core/api.d.cts +72 -84
  85. package/fullstacked_modules/zod/v4/core/api.d.ts +72 -84
  86. package/fullstacked_modules/zod/v4/core/checks.d.cts +2 -2
  87. package/fullstacked_modules/zod/v4/core/checks.d.ts +2 -2
  88. package/fullstacked_modules/zod/v4/core/doc.d.cts +1 -1
  89. package/fullstacked_modules/zod/v4/core/doc.d.ts +1 -1
  90. package/fullstacked_modules/zod/v4/core/errors.d.cts +22 -24
  91. package/fullstacked_modules/zod/v4/core/errors.d.ts +22 -24
  92. package/fullstacked_modules/zod/v4/core/json-schema.d.cts +3 -3
  93. package/fullstacked_modules/zod/v4/core/json-schema.d.ts +3 -3
  94. package/fullstacked_modules/zod/v4/core/regexes.d.cts +2 -2
  95. package/fullstacked_modules/zod/v4/core/regexes.d.ts +2 -2
  96. package/fullstacked_modules/zod/v4/core/registries.d.cts +1 -1
  97. package/fullstacked_modules/zod/v4/core/registries.d.ts +1 -1
  98. package/fullstacked_modules/zod/v4/core/schemas.d.cts +6 -20
  99. package/fullstacked_modules/zod/v4/core/schemas.d.ts +6 -20
  100. package/fullstacked_modules/zod/v4/core/to-json-schema.d.cts +3 -4
  101. package/fullstacked_modules/zod/v4/core/to-json-schema.d.ts +3 -4
  102. package/fullstacked_modules/zod/v4/core/util.d.cts +0 -2
  103. package/fullstacked_modules/zod/v4/core/util.d.ts +0 -2
  104. package/fullstacked_modules/zod/v4/locales/ar.d.cts +1 -2
  105. package/fullstacked_modules/zod/v4/locales/az.d.cts +1 -2
  106. package/fullstacked_modules/zod/v4/locales/be.d.cts +1 -2
  107. package/fullstacked_modules/zod/v4/locales/ca.d.cts +1 -2
  108. package/fullstacked_modules/zod/v4/locales/cs.d.cts +1 -2
  109. package/fullstacked_modules/zod/v4/locales/de.d.cts +1 -2
  110. package/fullstacked_modules/zod/v4/locales/es.d.cts +1 -2
  111. package/fullstacked_modules/zod/v4/locales/fa.d.cts +1 -2
  112. package/fullstacked_modules/zod/v4/locales/fi.d.cts +1 -2
  113. package/fullstacked_modules/zod/v4/locales/fr-CA.d.cts +1 -2
  114. package/fullstacked_modules/zod/v4/locales/fr.d.cts +1 -2
  115. package/fullstacked_modules/zod/v4/locales/he.d.cts +1 -2
  116. package/fullstacked_modules/zod/v4/locales/hu.d.cts +1 -2
  117. package/fullstacked_modules/zod/v4/locales/id.d.cts +1 -2
  118. package/fullstacked_modules/zod/v4/locales/index.d.cts +0 -3
  119. package/fullstacked_modules/zod/v4/locales/index.d.ts +0 -3
  120. package/fullstacked_modules/zod/v4/locales/it.d.cts +1 -2
  121. package/fullstacked_modules/zod/v4/locales/ja.d.cts +1 -2
  122. package/fullstacked_modules/zod/v4/locales/kh.d.cts +1 -2
  123. package/fullstacked_modules/zod/v4/locales/ko.d.cts +1 -2
  124. package/fullstacked_modules/zod/v4/locales/mk.d.cts +1 -2
  125. package/fullstacked_modules/zod/v4/locales/ms.d.cts +1 -2
  126. package/fullstacked_modules/zod/v4/locales/nl.d.cts +1 -2
  127. package/fullstacked_modules/zod/v4/locales/no.d.cts +1 -2
  128. package/fullstacked_modules/zod/v4/locales/ota.d.cts +1 -2
  129. package/fullstacked_modules/zod/v4/locales/pl.d.cts +1 -2
  130. package/fullstacked_modules/zod/v4/locales/ps.d.cts +1 -2
  131. package/fullstacked_modules/zod/v4/locales/pt.d.cts +1 -2
  132. package/fullstacked_modules/zod/v4/locales/ru.d.cts +1 -2
  133. package/fullstacked_modules/zod/v4/locales/sl.d.cts +1 -2
  134. package/fullstacked_modules/zod/v4/locales/sv.d.cts +1 -2
  135. package/fullstacked_modules/zod/v4/locales/ta.d.cts +1 -2
  136. package/fullstacked_modules/zod/v4/locales/th.d.cts +1 -2
  137. package/fullstacked_modules/zod/v4/locales/ua.d.cts +1 -2
  138. package/fullstacked_modules/zod/v4/locales/ur.d.cts +1 -2
  139. package/fullstacked_modules/zod/v4/locales/vi.d.cts +1 -2
  140. package/fullstacked_modules/zod/v4/locales/zh-CN.d.cts +1 -2
  141. package/fullstacked_modules/zod/v4/locales/zh-TW.d.cts +1 -2
  142. package/fullstacked_modules/zod/v4/mini/schemas.d.cts +0 -2
  143. package/fullstacked_modules/zod/v4/mini/schemas.d.ts +0 -2
  144. package/index.js +1 -1
  145. package/package.json +7 -7
  146. package/fullstacked_modules/ai/package.json +0 -5
  147. package/fullstacked_modules/zod/locales/index.d.cts +0 -1
  148. package/fullstacked_modules/zod/locales/index.d.ts +0 -1
  149. package/fullstacked_modules/zod/mini/index.d.cts +0 -1
  150. package/fullstacked_modules/zod/mini/index.d.ts +0 -1
  151. package/fullstacked_modules/zod/src/locales/index.ts +0 -1
  152. package/fullstacked_modules/zod/src/mini/index.ts +0 -1
  153. package/fullstacked_modules/zod/src/v4/core/tests/extend.test.ts +0 -18
  154. package/fullstacked_modules/zod/src/v4/locales/bg.ts +0 -136
  155. package/fullstacked_modules/zod/src/v4/locales/da.ts +0 -141
  156. package/fullstacked_modules/zod/src/v4/locales/is.ts +0 -127
  157. package/fullstacked_modules/zod/src/v4/locales/yo.ts +0 -131
  158. package/fullstacked_modules/zod/v4/locales/bg.d.cts +0 -5
  159. package/fullstacked_modules/zod/v4/locales/bg.d.ts +0 -5
  160. package/fullstacked_modules/zod/v4/locales/da.d.cts +0 -5
  161. package/fullstacked_modules/zod/v4/locales/da.d.ts +0 -4
  162. package/fullstacked_modules/zod/v4/locales/is.d.cts +0 -5
  163. package/fullstacked_modules/zod/v4/locales/is.d.ts +0 -5
  164. package/fullstacked_modules/zod/v4/locales/yo.d.cts +0 -5
  165. package/fullstacked_modules/zod/v4/locales/yo.d.ts +0 -4
@@ -121,9 +121,6 @@ export interface _$ZodTypeInternals {
121
121
  */
122
122
  values?: util.PrimitiveSet | undefined;
123
123
 
124
- /** Default value bubbled up from */
125
- // default?: unknown | undefined;
126
-
127
124
  /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
128
125
  propValues?: util.PropValues | undefined;
129
126
 
@@ -319,7 +316,6 @@ export const $ZodString: core.$constructor<$ZodString> = /*@__PURE__*/ core.$con
319
316
  payload.issues.push({
320
317
  expected: "string",
321
318
  code: "invalid_type",
322
-
323
319
  input: payload.value,
324
320
  inst,
325
321
  });
@@ -418,7 +414,6 @@ export const $ZodEmail: core.$constructor<$ZodEmail> = /*@__PURE__*/ core.$const
418
414
  export interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
419
415
  hostname?: RegExp | undefined;
420
416
  protocol?: RegExp | undefined;
421
- normalize?: boolean | undefined;
422
417
  }
423
418
  export interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
424
419
  def: $ZodURLDef;
@@ -432,10 +427,9 @@ export const $ZodURL: core.$constructor<$ZodURL> = /*@__PURE__*/ core.$construct
432
427
  $ZodStringFormat.init(inst, def);
433
428
  inst._zod.check = (payload) => {
434
429
  try {
435
- // Trim whitespace from input
436
- const trimmed = payload.value.trim();
437
- // @ts-ignore
438
- const url = new URL(trimmed);
430
+ const orig = payload.value;
431
+ const url = new URL(orig);
432
+ const href = url.href;
439
433
 
440
434
  if (def.hostname) {
441
435
  def.hostname.lastIndex = 0;
@@ -467,13 +461,11 @@ export const $ZodURL: core.$constructor<$ZodURL> = /*@__PURE__*/ core.$construct
467
461
  }
468
462
  }
469
463
 
470
- // Set the output value based on normalize flag
471
- if (def.normalize) {
472
- // Use normalized URL
473
- payload.value = url.href;
464
+ // payload.value = url.href;
465
+ if (!orig.endsWith("/") && href.endsWith("/")) {
466
+ payload.value = href.slice(0, -1);
474
467
  } else {
475
- // Preserve the original input (trimmed)
476
- payload.value = trimmed;
468
+ payload.value = href;
477
469
  }
478
470
 
479
471
  return;
@@ -727,7 +719,6 @@ export const $ZodIPv6: core.$constructor<$ZodIPv6> = /*@__PURE__*/ core.$constru
727
719
 
728
720
  inst._zod.check = (payload) => {
729
721
  try {
730
- // @ts-ignore
731
722
  new URL(`http://[${payload.value}]`);
732
723
  // return;
733
724
  } catch {
@@ -791,7 +782,6 @@ export const $ZodCIDRv6: core.$constructor<$ZodCIDRv6> = /*@__PURE__*/ core.$con
791
782
  const prefixNum = Number(prefix);
792
783
  if (`${prefixNum}` !== prefix) throw new Error();
793
784
  if (prefixNum < 0 || prefixNum > 128) throw new Error();
794
- // @ts-ignore
795
785
  new URL(`http://[${address}]`);
796
786
  } catch {
797
787
  payload.issues.push({
@@ -811,7 +801,6 @@ export function isValidBase64(data: string): boolean {
811
801
  if (data === "") return true;
812
802
  if (data.length % 4 !== 0) return false;
813
803
  try {
814
- // @ts-ignore
815
804
  atob(data);
816
805
  return true;
817
806
  } catch {
@@ -911,7 +900,6 @@ export function isValidJWT(token: string, algorithm: util.JWTAlgorithm | null =
911
900
  if (tokensParts.length !== 3) return false;
912
901
  const [header] = tokensParts;
913
902
  if (!header) return false;
914
- // @ts-ignore
915
903
  const parsedHeader = JSON.parse(atob(header));
916
904
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
917
905
  if (!parsedHeader.alg) return false;
@@ -1042,7 +1030,6 @@ export const $ZodNumber: core.$constructor<$ZodNumber> = /*@__PURE__*/ core.$con
1042
1030
  payload.issues.push({
1043
1031
  expected: "number",
1044
1032
  code: "invalid_type",
1045
-
1046
1033
  input,
1047
1034
  inst,
1048
1035
  ...(received ? { received } : {}),
@@ -1113,7 +1100,6 @@ export const $ZodBoolean: core.$constructor<$ZodBoolean> = /*@__PURE__*/ core.$c
1113
1100
  payload.issues.push({
1114
1101
  expected: "boolean",
1115
1102
  code: "invalid_type",
1116
-
1117
1103
  input,
1118
1104
  inst,
1119
1105
  });
@@ -1166,7 +1152,6 @@ export const $ZodBigInt: core.$constructor<$ZodBigInt> = /*@__PURE__*/ core.$con
1166
1152
  payload.issues.push({
1167
1153
  expected: "bigint",
1168
1154
  code: "invalid_type",
1169
-
1170
1155
  input: payload.value,
1171
1156
  inst,
1172
1157
  });
@@ -1226,7 +1211,6 @@ export const $ZodSymbol: core.$constructor<$ZodSymbol> = /*@__PURE__*/ core.$con
1226
1211
  payload.issues.push({
1227
1212
  expected: "symbol",
1228
1213
  code: "invalid_type",
1229
-
1230
1214
  input,
1231
1215
  inst,
1232
1216
  });
@@ -1271,7 +1255,6 @@ export const $ZodUndefined: core.$constructor<$ZodUndefined> = /*@__PURE__*/ cor
1271
1255
  payload.issues.push({
1272
1256
  expected: "undefined",
1273
1257
  code: "invalid_type",
1274
-
1275
1258
  input,
1276
1259
  inst,
1277
1260
  });
@@ -1314,7 +1297,6 @@ export const $ZodNull: core.$constructor<$ZodNull> = /*@__PURE__*/ core.$constru
1314
1297
  payload.issues.push({
1315
1298
  expected: "null",
1316
1299
  code: "invalid_type",
1317
-
1318
1300
  input,
1319
1301
  inst,
1320
1302
  });
@@ -1406,7 +1388,6 @@ export const $ZodNever: core.$constructor<$ZodNever> = /*@__PURE__*/ core.$const
1406
1388
  payload.issues.push({
1407
1389
  expected: "never",
1408
1390
  code: "invalid_type",
1409
-
1410
1391
  input: payload.value,
1411
1392
  inst,
1412
1393
  });
@@ -1444,7 +1425,6 @@ export const $ZodVoid: core.$constructor<$ZodVoid> = /*@__PURE__*/ core.$constru
1444
1425
  payload.issues.push({
1445
1426
  expected: "void",
1446
1427
  code: "invalid_type",
1447
-
1448
1428
  input,
1449
1429
  inst,
1450
1430
  });
@@ -1495,7 +1475,6 @@ export const $ZodDate: core.$constructor<$ZodDate> = /*@__PURE__*/ core.$constru
1495
1475
  payload.issues.push({
1496
1476
  expected: "date",
1497
1477
  code: "invalid_type",
1498
-
1499
1478
  input,
1500
1479
  ...(isDate ? { received: "Invalid Date" } : {}),
1501
1480
  inst,
@@ -1545,7 +1524,6 @@ export const $ZodArray: core.$constructor<$ZodArray> = /*@__PURE__*/ core.$const
1545
1524
  payload.issues.push({
1546
1525
  expected: "array",
1547
1526
  code: "invalid_type",
1548
-
1549
1527
  input,
1550
1528
  inst,
1551
1529
  });
@@ -1604,36 +1582,6 @@ export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<st
1604
1582
  } & Extra
1605
1583
  >;
1606
1584
 
1607
- // experimental
1608
- // export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = keyof (T &
1609
- // Extra) extends never
1610
- // ? Record<string, never>
1611
- // : string extends keyof T
1612
- // ? util.Prettify<
1613
- // {
1614
- // [k: string]: util.IsAny<T[string]["_zod"]["output"]> extends true ? unknown : T[string]["_zod"]["output"];
1615
- // } & $InferObjectOutputNoIndex<util.OmitIndexSignature<T>, Extra>
1616
- // >
1617
- // : util.Prettify<$InferObjectOutputNoIndex<T, Extra>>;
1618
-
1619
- // export type $InferObjectOutputNoIndex<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = {
1620
- // [k in keyof T as string extends k
1621
- // ? never
1622
- // : k extends string
1623
- // ? T[k] extends OptionalOutSchema
1624
- // ? never
1625
- // : k
1626
- // : never]: T[k]["_zod"]["output"];
1627
- // } & {
1628
- // [k in keyof T as string extends k
1629
- // ? never
1630
- // : k extends string
1631
- // ? T[k] extends OptionalOutSchema
1632
- // ? k
1633
- // : never
1634
- // : never]?: T[k]["_zod"]["output"];
1635
- // } & Extra;
1636
-
1637
1585
  export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T
1638
1586
  ? util.IsAny<T[keyof T]> extends true
1639
1587
  ? Record<string, unknown>
@@ -1648,16 +1596,33 @@ export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<str
1648
1596
  } & Extra
1649
1597
  >;
1650
1598
 
1651
- function handlePropertyResult(result: ParsePayload, final: ParsePayload, key: PropertyKey, input: any) {
1599
+ function handleObjectResult(result: ParsePayload, final: ParsePayload, key: PropertyKey) {
1600
+ // if(isOptional)
1652
1601
  if (result.issues.length) {
1653
1602
  final.issues.push(...util.prefixIssues(key, result.issues));
1654
1603
  }
1655
1604
 
1656
- if (result.value === undefined) {
1657
- if (key in input) {
1658
- (final.value as any)[key] = undefined;
1605
+ (final.value as any)[key] = result.value;
1606
+ }
1607
+
1608
+ function handleOptionalObjectResult(result: ParsePayload, final: ParsePayload, key: PropertyKey, input: any) {
1609
+ if (result.issues.length) {
1610
+ // validation failed against value schema
1611
+ if (input[key] === undefined) {
1612
+ // if input was undefined, ignore the error
1613
+ if (key in input) {
1614
+ (final.value as any)[key] = undefined;
1615
+ } else {
1616
+ (final.value as any)[key] = result.value;
1617
+ }
1618
+ } else {
1619
+ final.issues.push(...util.prefixIssues(key, result.issues));
1659
1620
  }
1621
+ } else if (result.value === undefined) {
1622
+ // validation returned `undefined`
1623
+ if (key in input) (final.value as any)[key] = undefined;
1660
1624
  } else {
1625
+ // non-undefined value
1661
1626
  (final.value as any)[key] = result.value;
1662
1627
  }
1663
1628
  }
@@ -1701,8 +1666,6 @@ export interface $ZodObjectInternals<
1701
1666
  propValues: util.PropValues;
1702
1667
  output: $InferObjectOutput<Shape, Config["out"]>;
1703
1668
  input: $InferObjectInput<Shape, Config["in"]>;
1704
- optin?: "optional" | undefined;
1705
- optout?: "optional" | undefined;
1706
1669
  }
1707
1670
  export type $ZodLooseShape = Record<string, any>;
1708
1671
 
@@ -1769,25 +1732,41 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
1769
1732
  // A: preserve key order {
1770
1733
  doc.write(`const newResult = {}`);
1771
1734
  for (const key of normalized.keys) {
1772
- const id = ids[key];
1773
- const k = util.esc(key);
1774
- doc.write(`const ${id} = ${parseStr(key)};`);
1775
- doc.write(`
1735
+ if (normalized.optionalKeys.has(key)) {
1736
+ const id = ids[key];
1737
+ doc.write(`const ${id} = ${parseStr(key)};`);
1738
+ const k = util.esc(key);
1739
+ doc.write(`
1776
1740
  if (${id}.issues.length) {
1777
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1778
- ...iss,
1779
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1780
- })));
1781
- }
1782
-
1783
- if (${id}.value === undefined) {
1784
- if (${k} in input) {
1785
- newResult[${k}] = undefined;
1741
+ if (input[${k}] === undefined) {
1742
+ if (${k} in input) {
1743
+ newResult[${k}] = undefined;
1744
+ }
1745
+ } else {
1746
+ payload.issues = payload.issues.concat(
1747
+ ${id}.issues.map((iss) => ({
1748
+ ...iss,
1749
+ path: iss.path ? [${k}, ...iss.path] : [${k}],
1750
+ }))
1751
+ );
1786
1752
  }
1753
+ } else if (${id}.value === undefined) {
1754
+ if (${k} in input) newResult[${k}] = undefined;
1787
1755
  } else {
1788
1756
  newResult[${k}] = ${id}.value;
1789
1757
  }
1790
- `);
1758
+ `);
1759
+ } else {
1760
+ const id = ids[key];
1761
+ // const id = ids[key];
1762
+ doc.write(`const ${id} = ${parseStr(key)};`);
1763
+ doc.write(`
1764
+ if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1765
+ ...iss,
1766
+ path: iss.path ? [${util.esc(key)}, ...iss.path] : [${util.esc(key)}]
1767
+ })));`);
1768
+ doc.write(`newResult[${util.esc(key)}] = ${id}.value`);
1769
+ }
1791
1770
  }
1792
1771
 
1793
1772
  doc.write(`payload.value = newResult;`);
@@ -1814,7 +1793,6 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
1814
1793
  payload.issues.push({
1815
1794
  expected: "object",
1816
1795
  code: "invalid_type",
1817
-
1818
1796
  input,
1819
1797
  inst,
1820
1798
  });
@@ -1833,16 +1811,39 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
1833
1811
  const shape = value.shape;
1834
1812
  for (const key of value.keys) {
1835
1813
  const el = shape[key]!;
1814
+
1815
+ // do not add omitted optional keys
1816
+ // if (!(key in input)) {
1817
+ // if (optionalKeys.has(key)) continue;
1818
+ // payload.issues.push({
1819
+ // code: "invalid_type",
1820
+ // path: [key],
1821
+ // expected: "nonoptional",
1822
+ // note: `Missing required key: "${key}"`,
1823
+ // input,
1824
+ // inst,
1825
+ // });
1826
+ // }
1827
+
1836
1828
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1829
+ const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
1830
+
1837
1831
  if (r instanceof Promise) {
1838
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));
1832
+ proms.push(
1833
+ r.then((r) =>
1834
+ isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)
1835
+ )
1836
+ );
1837
+ } else if (isOptional) {
1838
+ handleOptionalObjectResult(r, payload, key, input);
1839
1839
  } else {
1840
- handlePropertyResult(r, payload, key, input);
1840
+ handleObjectResult(r, payload, key);
1841
1841
  }
1842
1842
  }
1843
1843
  }
1844
1844
 
1845
1845
  if (!catchall) {
1846
+ // return payload;
1846
1847
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
1847
1848
  }
1848
1849
  const unrecognized: string[] = [];
@@ -1859,16 +1860,15 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
1859
1860
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1860
1861
 
1861
1862
  if (r instanceof Promise) {
1862
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));
1863
+ proms.push(r.then((r) => handleObjectResult(r, payload, key)));
1863
1864
  } else {
1864
- handlePropertyResult(r, payload, key, input);
1865
+ handleObjectResult(r, payload, key);
1865
1866
  }
1866
1867
  }
1867
1868
 
1868
1869
  if (unrecognized.length) {
1869
1870
  payload.issues.push({
1870
1871
  code: "unrecognized_keys",
1871
-
1872
1872
  keys: unrecognized,
1873
1873
  input,
1874
1874
  inst,
@@ -1925,15 +1925,8 @@ function handleUnionResults(results: ParsePayload[], final: ParsePayload, inst:
1925
1925
  }
1926
1926
  }
1927
1927
 
1928
- const nonaborted = results.filter((r) => !util.aborted(r));
1929
- if (nonaborted.length === 1) {
1930
- final.value = nonaborted[0].value;
1931
- return nonaborted[0];
1932
- }
1933
-
1934
1928
  final.issues.push({
1935
1929
  code: "invalid_union",
1936
-
1937
1930
  input: final.value,
1938
1931
  inst,
1939
1932
  errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
@@ -1968,13 +1961,7 @@ export const $ZodUnion: core.$constructor<$ZodUnion> = /*@__PURE__*/ core.$const
1968
1961
  return undefined;
1969
1962
  });
1970
1963
 
1971
- const single = def.options.length === 1;
1972
- const first = def.options[0]._zod.run;
1973
-
1974
1964
  inst._zod.parse = (payload, ctx) => {
1975
- if (single) {
1976
- return first(payload, ctx);
1977
- }
1978
1965
  let async = false;
1979
1966
 
1980
1967
  const results: util.MaybeAsync<ParsePayload>[] = [];
@@ -2052,7 +2039,7 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
2052
2039
  const opts = def.options as $ZodTypeDiscriminable[];
2053
2040
  const map: Map<util.Primitive, $ZodType> = new Map();
2054
2041
  for (const o of opts) {
2055
- const values = o._zod.propValues?.[def.discriminator];
2042
+ const values = o._zod.propValues[def.discriminator];
2056
2043
  if (!values || values.size === 0)
2057
2044
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
2058
2045
  for (const v of values) {
@@ -2070,7 +2057,6 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
2070
2057
  if (!util.isObject(input)) {
2071
2058
  payload.issues.push({
2072
2059
  code: "invalid_type",
2073
-
2074
2060
  expected: "object",
2075
2061
  input,
2076
2062
  inst,
@@ -2090,10 +2076,8 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
2090
2076
  // no matching discriminator
2091
2077
  payload.issues.push({
2092
2078
  code: "invalid_union",
2093
-
2094
2079
  errors: [],
2095
2080
  note: "No matching discriminator",
2096
- discriminator: def.discriminator,
2097
2081
  input,
2098
2082
  path: [def.discriminator],
2099
2083
  inst,
@@ -2119,14 +2103,11 @@ export interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right ext
2119
2103
  }
2120
2104
 
2121
2105
  export interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType>
2122
- extends _$ZodTypeInternals {
2123
- // $ZodTypeInternals<core.output<A> & core.output<B>, core.input<A> & core.input<B>>
2106
+ extends $ZodTypeInternals<core.output<A> & core.output<B>, core.input<A> & core.input<B>> {
2124
2107
  def: $ZodIntersectionDef<A, B>;
2125
2108
  isst: never;
2126
2109
  optin: A["_zod"]["optin"] | B["_zod"]["optin"];
2127
2110
  optout: A["_zod"]["optout"] | B["_zod"]["optout"];
2128
- output: core.output<A> & core.output<B>;
2129
- input: core.input<A> & core.input<B>;
2130
2111
  }
2131
2112
 
2132
2113
  export interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
@@ -2284,12 +2265,9 @@ type TupleOutputTypeWithOptionals<T extends util.TupleItems> = T extends readonl
2284
2265
  export interface $ZodTupleInternals<
2285
2266
  T extends util.TupleItems = readonly $ZodType[],
2286
2267
  Rest extends SomeType | null = $ZodType | null,
2287
- > extends _$ZodTypeInternals {
2268
+ > extends $ZodTypeInternals<$InferTupleOutputType<T, Rest>, $InferTupleInputType<T, Rest>> {
2288
2269
  def: $ZodTupleDef<T, Rest>;
2289
2270
  isst: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<unknown[]> | errors.$ZodIssueTooSmall<unknown[]>;
2290
- // $ZodTypeInternals<$InferTupleOutputType<T, Rest>, $InferTupleInputType<T, Rest>>
2291
- output: $InferTupleOutputType<T, Rest>;
2292
- input: $InferTupleInputType<T, Rest>;
2293
2271
  }
2294
2272
 
2295
2273
  export interface $ZodTuple<
@@ -2324,11 +2302,10 @@ export const $ZodTuple: core.$constructor<$ZodTuple> = /*@__PURE__*/ core.$const
2324
2302
  const tooSmall = input.length < optStart - 1;
2325
2303
  if (tooBig || tooSmall) {
2326
2304
  payload.issues.push({
2327
- ...(tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }),
2328
-
2329
2305
  input,
2330
2306
  inst,
2331
2307
  origin: "array" as const,
2308
+ ...(tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }),
2332
2309
  });
2333
2310
  return payload;
2334
2311
  }
@@ -2463,7 +2440,6 @@ export const $ZodRecord: core.$constructor<$ZodRecord> = /*@__PURE__*/ core.$con
2463
2440
  payload.issues.push({
2464
2441
  expected: "record",
2465
2442
  code: "invalid_type",
2466
-
2467
2443
  input,
2468
2444
  inst,
2469
2445
  });
@@ -2507,7 +2483,6 @@ export const $ZodRecord: core.$constructor<$ZodRecord> = /*@__PURE__*/ core.$con
2507
2483
  if (unrecognized && unrecognized.length > 0) {
2508
2484
  payload.issues.push({
2509
2485
  code: "unrecognized_keys",
2510
-
2511
2486
  input,
2512
2487
  inst,
2513
2488
  keys: unrecognized,
@@ -2525,9 +2500,8 @@ export const $ZodRecord: core.$constructor<$ZodRecord> = /*@__PURE__*/ core.$con
2525
2500
 
2526
2501
  if (keyResult.issues.length) {
2527
2502
  payload.issues.push({
2528
- code: "invalid_key",
2529
-
2530
2503
  origin: "record",
2504
+ code: "invalid_key",
2531
2505
  issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
2532
2506
  input: key,
2533
2507
  path: [key],
@@ -2598,7 +2572,6 @@ export const $ZodMap: core.$constructor<$ZodMap> = /*@__PURE__*/ core.$construct
2598
2572
  payload.issues.push({
2599
2573
  expected: "map",
2600
2574
  code: "invalid_type",
2601
-
2602
2575
  input,
2603
2576
  inst,
2604
2577
  });
@@ -2642,9 +2615,8 @@ function handleMapResult(
2642
2615
  final.issues.push(...util.prefixIssues(key as PropertyKey, keyResult.issues));
2643
2616
  } else {
2644
2617
  final.issues.push({
2645
- code: "invalid_key",
2646
-
2647
2618
  origin: "map",
2619
+ code: "invalid_key",
2648
2620
  input,
2649
2621
  inst,
2650
2622
  issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
@@ -2658,7 +2630,6 @@ function handleMapResult(
2658
2630
  final.issues.push({
2659
2631
  origin: "map",
2660
2632
  code: "invalid_element",
2661
-
2662
2633
  input,
2663
2634
  inst,
2664
2635
  key: key,
@@ -2766,8 +2737,8 @@ export const $ZodEnum: core.$constructor<$ZodEnum> = /*@__PURE__*/ core.$constru
2766
2737
  $ZodType.init(inst, def);
2767
2738
 
2768
2739
  const values = util.getEnumValues(def.entries);
2769
- const valuesSet = new Set<util.Primitive>(values);
2770
- inst._zod.values = valuesSet;
2740
+
2741
+ inst._zod.values = new Set<util.Primitive>(values);
2771
2742
 
2772
2743
  inst._zod.pattern = new RegExp(
2773
2744
  `^(${values
@@ -2778,12 +2749,11 @@ export const $ZodEnum: core.$constructor<$ZodEnum> = /*@__PURE__*/ core.$constru
2778
2749
 
2779
2750
  inst._zod.parse = (payload, _ctx) => {
2780
2751
  const input = payload.value;
2781
- if (valuesSet.has(input)) {
2752
+ if (inst._zod.values.has(input)) {
2782
2753
  return payload;
2783
2754
  }
2784
2755
  payload.issues.push({
2785
2756
  code: "invalid_value",
2786
-
2787
2757
  values,
2788
2758
  input,
2789
2759
  inst,
@@ -2820,15 +2790,12 @@ export const $ZodLiteral: core.$constructor<$ZodLiteral> = /*@__PURE__*/ core.$c
2820
2790
  "$ZodLiteral",
2821
2791
  (inst, def) => {
2822
2792
  $ZodType.init(inst, def);
2823
- if (def.values.length === 0) {
2824
- throw new Error("Cannot create literal schema with no valid values");
2825
- }
2826
2793
 
2827
2794
  inst._zod.values = new Set<util.Literal>(def.values);
2828
2795
  inst._zod.pattern = new RegExp(
2829
2796
  `^(${def.values
2830
2797
 
2831
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
2798
+ .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? o.toString() : String(o)))
2832
2799
  .join("|")})$`
2833
2800
  );
2834
2801
 
@@ -2839,7 +2806,6 @@ export const $ZodLiteral: core.$constructor<$ZodLiteral> = /*@__PURE__*/ core.$c
2839
2806
  }
2840
2807
  payload.issues.push({
2841
2808
  code: "invalid_value",
2842
-
2843
2809
  values: def.values,
2844
2810
  input,
2845
2811
  inst,
@@ -2899,11 +2865,8 @@ export const $ZodLiteral: core.$constructor<$ZodLiteral> = /*@__PURE__*/ core.$c
2899
2865
  //////////////////////////////////////////
2900
2866
 
2901
2867
  // provide a fallback in case the File interface isn't provided in the environment
2902
- type _File = typeof globalThis extends { File: infer F extends new (...args: any[]) => any } ? InstanceType<F> : {};
2903
- /** Do not reference this directly. */
2904
- export interface File extends _File {
2905
- readonly type: string;
2906
- readonly size: number;
2868
+ declare global {
2869
+ interface File {}
2907
2870
  }
2908
2871
 
2909
2872
  export interface $ZodFileDef extends $ZodTypeDef {
@@ -2929,12 +2892,10 @@ export const $ZodFile: core.$constructor<$ZodFile> = /*@__PURE__*/ core.$constru
2929
2892
 
2930
2893
  inst._zod.parse = (payload, _ctx) => {
2931
2894
  const input = payload.value;
2932
- // @ts-ignore
2933
2895
  if (input instanceof File) return payload;
2934
2896
  payload.issues.push({
2935
2897
  expected: "file",
2936
2898
  code: "invalid_type",
2937
-
2938
2899
  input,
2939
2900
  inst,
2940
2901
  });
@@ -3012,13 +2973,6 @@ export interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
3012
2973
  _zod: $ZodOptionalInternals<T>;
3013
2974
  }
3014
2975
 
3015
- function handleOptionalResult(result: ParsePayload, input: unknown) {
3016
- if (result.issues.length && input === undefined) {
3017
- return { issues: [], value: undefined };
3018
- }
3019
- return result;
3020
- }
3021
-
3022
2976
  export const $ZodOptional: core.$constructor<$ZodOptional> = /*@__PURE__*/ core.$constructor(
3023
2977
  "$ZodOptional",
3024
2978
  (inst, def) => {
@@ -3036,9 +2990,7 @@ export const $ZodOptional: core.$constructor<$ZodOptional> = /*@__PURE__*/ core.
3036
2990
 
3037
2991
  inst._zod.parse = (payload, ctx) => {
3038
2992
  if (def.innerType._zod.optin === "optional") {
3039
- const result = def.innerType._zod.run(payload, ctx);
3040
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
3041
- return handleOptionalResult(result, payload.value);
2993
+ return def.innerType._zod.run(payload, ctx);
3042
2994
  }
3043
2995
  if (payload.value === undefined) {
3044
2996
  return payload;
@@ -3252,7 +3204,6 @@ function handleNonOptionalResult(payload: ParsePayload, inst: $ZodNonOptional) {
3252
3204
  if (!payload.issues.length && payload.value === undefined) {
3253
3205
  payload.issues.push({
3254
3206
  code: "invalid_type",
3255
-
3256
3207
  expected: "nonoptional",
3257
3208
  input: payload.value,
3258
3209
  inst,
@@ -3363,8 +3314,11 @@ export interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef
3363
3314
  }
3364
3315
 
3365
3316
  export interface $ZodCatchInternals<T extends SomeType = $ZodType>
3366
- extends $ZodTypeInternals<core.output<T>, core.input<T>> {
3317
+ extends $ZodTypeInternals<core.output<T>, core.input<T> | util.Whatever> {
3367
3318
  def: $ZodCatchDef<T>;
3319
+ // qin: T["_zod"]["qin"];
3320
+ // qout: T["_zod"]["qout"];
3321
+
3368
3322
  optin: T["_zod"]["optin"];
3369
3323
  optout: T["_zod"]["optout"];
3370
3324
  isst: never;
@@ -3377,7 +3331,7 @@ export interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
3377
3331
 
3378
3332
  export const $ZodCatch: core.$constructor<$ZodCatch> = /*@__PURE__*/ core.$constructor("$ZodCatch", (inst, def) => {
3379
3333
  $ZodType.init(inst, def);
3380
- util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
3334
+ inst._zod.optin = "optional";
3381
3335
  util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
3382
3336
  util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
3383
3337
 
@@ -3410,7 +3364,6 @@ export const $ZodCatch: core.$constructor<$ZodCatch> = /*@__PURE__*/ core.$const
3410
3364
  },
3411
3365
  input: payload.value,
3412
3366
  });
3413
-
3414
3367
  payload.issues = [];
3415
3368
  }
3416
3369
 
@@ -3475,7 +3428,6 @@ export interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends Some
3475
3428
  values: A["_zod"]["values"];
3476
3429
  optin: A["_zod"]["optin"];
3477
3430
  optout: B["_zod"]["optout"];
3478
- propValues: A["_zod"]["propValues"];
3479
3431
  }
3480
3432
 
3481
3433
  export interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
@@ -3487,7 +3439,6 @@ export const $ZodPipe: core.$constructor<$ZodPipe> = /*@__PURE__*/ core.$constru
3487
3439
  util.defineLazy(inst._zod, "values", () => def.in._zod.values);
3488
3440
  util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
3489
3441
  util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
3490
- util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
3491
3442
 
3492
3443
  inst._zod.parse = (payload, ctx) => {
3493
3444
  const left = def.in._zod.run(payload, ctx);
@@ -3499,7 +3450,7 @@ export const $ZodPipe: core.$constructor<$ZodPipe> = /*@__PURE__*/ core.$constru
3499
3450
  });
3500
3451
 
3501
3452
  function handlePipeResult(left: ParsePayload, def: $ZodPipeDef, ctx: ParseContext) {
3502
- if (left.issues.length) {
3453
+ if (util.aborted(left)) {
3503
3454
  return left;
3504
3455
  }
3505
3456
  return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);
@@ -3567,7 +3518,6 @@ function handleReadonlyResult(payload: ParsePayload): ParsePayload {
3567
3518
  export interface $ZodTemplateLiteralDef extends $ZodTypeDef {
3568
3519
  type: "template_literal";
3569
3520
  parts: $ZodTemplateLiteralPart[];
3570
- format?: string | undefined;
3571
3521
  }
3572
3522
  export interface $ZodTemplateLiteralInternals<Template extends string = string>
3573
3523
  extends $ZodTypeInternals<Template, Template> {
@@ -3673,9 +3623,8 @@ export const $ZodTemplateLiteral: core.$constructor<$ZodTemplateLiteral> = /*@__
3673
3623
  payload.issues.push({
3674
3624
  input: payload.value,
3675
3625
  inst,
3676
-
3677
3626
  code: "invalid_format",
3678
- format: def.format ?? "template_literal",
3627
+ format: "template_literal",
3679
3628
  pattern: inst._zod.pattern.source,
3680
3629
  });
3681
3630
  return payload;
@@ -3751,18 +3700,11 @@ export interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
3751
3700
  export const $ZodLazy: core.$constructor<$ZodLazy> = /*@__PURE__*/ core.$constructor("$ZodLazy", (inst, def) => {
3752
3701
  $ZodType.init(inst, def);
3753
3702
 
3754
- // let _innerType!: any;
3755
- // util.defineLazy(def, "getter", () => {
3756
- // if (!_innerType) {
3757
- // _innerType = def.getter();
3758
- // }
3759
- // return () => _innerType;
3760
- // });
3761
3703
  util.defineLazy(inst._zod, "innerType", () => def.getter() as $ZodType);
3762
3704
  util.defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
3763
3705
  util.defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
3764
- util.defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? undefined);
3765
- util.defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? undefined);
3706
+ util.defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
3707
+ util.defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
3766
3708
  inst._zod.parse = (payload, ctx) => {
3767
3709
  const inner = inst._zod.innerType;
3768
3710
  return inner._zod.run(payload, ctx);