@es-joy/jsoe 0.26.0 → 0.27.0

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 (130) hide show
  1. package/.gitignore +10 -0
  2. package/.npmignore +9 -0
  3. package/CHANGES.md +53 -0
  4. package/README.md +3 -3
  5. package/badges/coverage-badge.svg +1 -1
  6. package/dist/formats/schema.d.ts.map +1 -1
  7. package/dist/fundamentalTypes/arrayReferenceType.d.ts.map +1 -1
  8. package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
  9. package/dist/fundamentalTypes/regexpType.d.ts.map +1 -1
  10. package/dist/fundamentalTypes/stringType.d.ts.map +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/typeChoices.d.ts.map +1 -1
  14. package/dist/types.d.ts +12 -3
  15. package/dist/types.d.ts.map +1 -1
  16. package/eslint.config.js +36 -26
  17. package/package.json +13 -11
  18. package/pnpm-workspace.yaml +3 -2
  19. package/src/formatAndTypeChoices.js +9 -9
  20. package/src/formats/schema.js +70 -19
  21. package/src/fundamentalTypes/arrayReferenceType.js +3 -2
  22. package/src/fundamentalTypes/arrayType.js +34 -9
  23. package/src/fundamentalTypes/regexpType.js +9 -1
  24. package/src/fundamentalTypes/stringType.js +5 -0
  25. package/src/typeChoices.js +17 -8
  26. package/src/types.js +19 -8
  27. package/vendor/typeson-registry/dist/index.js +83 -10
  28. package/vendor/zod/classic/checks.d.ts +1 -1
  29. package/vendor/zod/classic/checks.js +1 -1
  30. package/vendor/zod/classic/external.d.ts +1 -1
  31. package/vendor/zod/classic/external.js +1 -1
  32. package/vendor/zod/classic/from-json-schema.js +245 -24
  33. package/vendor/zod/classic/schemas.d.ts +17 -1
  34. package/vendor/zod/classic/schemas.js +77 -29
  35. package/vendor/zod/core/api.d.ts +6 -4
  36. package/vendor/zod/core/api.js +17 -2
  37. package/vendor/zod/core/checks.d.ts +1 -1
  38. package/vendor/zod/core/checks.js +0 -96
  39. package/vendor/zod/core/compile.d.ts +18 -4
  40. package/vendor/zod/core/compile.js +146 -67
  41. package/vendor/zod/core/doc.js +7 -2
  42. package/vendor/zod/core/errors.js +2 -5
  43. package/vendor/zod/core/json-schema-generator.js +2 -2
  44. package/vendor/zod/core/json-schema-processors.d.ts +17 -0
  45. package/vendor/zod/core/json-schema-processors.js +195 -64
  46. package/vendor/zod/core/memoizer.js +72 -23
  47. package/vendor/zod/core/parse.js +37 -16
  48. package/vendor/zod/core/regexes.d.ts +2 -0
  49. package/vendor/zod/core/regexes.js +8 -4
  50. package/vendor/zod/core/schemas.d.ts +42 -7
  51. package/vendor/zod/core/schemas.js +301 -94
  52. package/vendor/zod/core/to-json-schema.d.ts +7 -3
  53. package/vendor/zod/core/to-json-schema.js +8 -7
  54. package/vendor/zod/core/util.d.ts +25 -4
  55. package/vendor/zod/core/util.js +160 -143
  56. package/vendor/zod/core/versions.d.ts +1 -1
  57. package/vendor/zod/core/versions.js +2 -2
  58. package/vendor/zod/core/visit.js +12 -0
  59. package/vendor/zod/locales/ar.js +1 -0
  60. package/vendor/zod/locales/az.js +1 -0
  61. package/vendor/zod/locales/be.js +1 -0
  62. package/vendor/zod/locales/bg.js +1 -0
  63. package/vendor/zod/locales/bn.js +1 -0
  64. package/vendor/zod/locales/ca.js +1 -0
  65. package/vendor/zod/locales/ckb.js +1 -0
  66. package/vendor/zod/locales/cs.js +1 -0
  67. package/vendor/zod/locales/da.js +1 -0
  68. package/vendor/zod/locales/de.js +1 -0
  69. package/vendor/zod/locales/el.js +1 -0
  70. package/vendor/zod/locales/en.js +1 -0
  71. package/vendor/zod/locales/eo.js +1 -0
  72. package/vendor/zod/locales/es.js +1 -0
  73. package/vendor/zod/locales/fa.js +1 -0
  74. package/vendor/zod/locales/fi.js +1 -0
  75. package/vendor/zod/locales/fr-CA.js +1 -0
  76. package/vendor/zod/locales/fr.js +1 -0
  77. package/vendor/zod/locales/gu.js +1 -0
  78. package/vendor/zod/locales/he.js +1 -0
  79. package/vendor/zod/locales/hi.js +1 -0
  80. package/vendor/zod/locales/hr.js +1 -0
  81. package/vendor/zod/locales/hu.js +1 -0
  82. package/vendor/zod/locales/hy.js +1 -0
  83. package/vendor/zod/locales/id.js +1 -0
  84. package/vendor/zod/locales/index.d.ts +1 -0
  85. package/vendor/zod/locales/index.js +1 -0
  86. package/vendor/zod/locales/is.js +1 -0
  87. package/vendor/zod/locales/it.js +1 -0
  88. package/vendor/zod/locales/ja.js +1 -0
  89. package/vendor/zod/locales/ka.js +1 -0
  90. package/vendor/zod/locales/km.js +1 -0
  91. package/vendor/zod/locales/kn.js +1 -0
  92. package/vendor/zod/locales/ko.js +1 -0
  93. package/vendor/zod/locales/lt.js +1 -0
  94. package/vendor/zod/locales/mk.js +1 -0
  95. package/vendor/zod/locales/ms.js +1 -0
  96. package/vendor/zod/locales/ne.js +1 -0
  97. package/vendor/zod/locales/nl.js +1 -0
  98. package/vendor/zod/locales/nn.js +1 -0
  99. package/vendor/zod/locales/no.js +1 -0
  100. package/vendor/zod/locales/ota.js +1 -0
  101. package/vendor/zod/locales/pl.js +1 -0
  102. package/vendor/zod/locales/ps.js +1 -0
  103. package/vendor/zod/locales/pt-BR.js +1 -0
  104. package/vendor/zod/locales/pt.js +1 -0
  105. package/vendor/zod/locales/ro.js +1 -0
  106. package/vendor/zod/locales/ru.js +1 -0
  107. package/vendor/zod/locales/sk.js +1 -0
  108. package/vendor/zod/locales/sl.js +1 -0
  109. package/vendor/zod/locales/sv.js +1 -0
  110. package/vendor/zod/locales/ta.js +1 -0
  111. package/vendor/zod/locales/tg.d.ts +4 -0
  112. package/vendor/zod/locales/tg.js +116 -0
  113. package/vendor/zod/locales/th.js +1 -0
  114. package/vendor/zod/locales/tk.js +1 -0
  115. package/vendor/zod/locales/tr.js +1 -0
  116. package/vendor/zod/locales/uk.js +1 -0
  117. package/vendor/zod/locales/ur.js +1 -0
  118. package/vendor/zod/locales/uz.js +1 -0
  119. package/vendor/zod/locales/vi.js +1 -0
  120. package/vendor/zod/locales/yo.js +1 -0
  121. package/vendor/zod/locales/zh-CN.js +1 -0
  122. package/vendor/zod/locales/zh-TW.js +1 -0
  123. package/vendor/zod/mini/checks.d.ts +1 -1
  124. package/vendor/zod/mini/checks.js +1 -1
  125. package/vendor/zod/mini/external.d.ts +1 -1
  126. package/vendor/zod/mini/external.js +1 -1
  127. package/vendor/zod/mini/schemas.d.ts +8 -0
  128. package/vendor/zod/mini/schemas.js +19 -2
  129. package/vendor/zodexy/dist/esm/index.js +34 -1
  130. package/vendor/zodexy/dist/schema.zodexy.json +18 -0
@@ -709,7 +709,8 @@ const arrayType = {
709
709
  editUI ({
710
710
  typeNamespace, buildTypeChoices, format, // resultType,
711
711
  formats, types, specificSchemaObject, schemaFallingBack, schemaContent,
712
- type, forcedState, topRoot, value: objectValue, bringIntoFocus = true
712
+ type, forcedState, topRoot, value: objectValue, hasValue,
713
+ bringIntoFocus = true
713
714
  }) {
714
715
  const {sparse} = this;
715
716
  // eslint-disable-next-line consistent-this -- Clearer
@@ -1627,9 +1628,27 @@ const arrayType = {
1627
1628
  specificSchemaObject
1628
1629
  )?.element;
1629
1630
  }
1630
- return /** @type {import('zodexy').SzObject} */ (
1631
+ const objectSchema = /** @type {import('zodexy').SzObject} */ (
1631
1632
  specificSchemaObject
1632
- )?.properties?.[/** @type {string} */ (propName)];
1633
+ );
1634
+ const schemaType = specificSchemaObject?.type;
1635
+ const propSchema = objectSchema?.properties?.[/** @type {string} */ (
1636
+ propName
1637
+ )];
1638
+ if (
1639
+ !propSchema &&
1640
+ (schemaType === 'properties' ||
1641
+ (schemaType === 'object' && !objectSchema.catchall))
1642
+ ) {
1643
+ // A key outside the declared shape of a `z.properties()` (which keeps
1644
+ // it) or a `catchall`-less `z.object()` (which strips it on parse but
1645
+ // still shows it while editing): offer the unconstrained type choice
1646
+ // rather than an unschema'd control, as a `looseRecord`'s
1647
+ // non-conforming entry gets. An `object` `catchall` takes precedence
1648
+ // (handled where the per-property schema is chosen elsewhere).
1649
+ return /** @type {import('zodexy').SzType} */ ({type: 'unknown'});
1650
+ }
1651
+ return propSchema;
1633
1652
  };
1634
1653
 
1635
1654
  /**
@@ -2611,10 +2630,16 @@ const arrayType = {
2611
2630
  }
2612
2631
  }, /** @type {import('jamilih').JamilihChildren} */ ([
2613
2632
  [specificSchemaObject ? 'span' : 'b', {
2614
- title: schemaLabel(specificSchemaObject) ?? (DOM.initialCaps(
2615
- /** @type {import('../types.js').AvailableType} */
2616
- (itemType)
2617
- ).replace(/s$/u, ''))
2633
+ title: schemaLabel(specificSchemaObject) ?? (
2634
+ // `z.properties()` renders through the `object` UI; without a
2635
+ // `meta` label of its own, name it "Properties" rather than an
2636
+ // indistinguishable "Object".
2637
+ specificSchemaObject?.type === 'properties'
2638
+ ? 'Properties'
2639
+ : DOM.initialCaps(
2640
+ /** @type {import('../types.js').AvailableType} */
2641
+ (itemType)
2642
+ ).replace(/s$/u, ''))
2618
2643
  }, [
2619
2644
  specificSchemaObject
2620
2645
  ? '—'
@@ -2664,7 +2689,7 @@ const arrayType = {
2664
2689
  );
2665
2690
  topRoot ||= div;
2666
2691
 
2667
- if (!objectValue && specificSchemaObject && tupleMode) {
2692
+ if (!hasValue && specificSchemaObject && tupleMode) {
2668
2693
  // See comment referencing `arrayType.js` in `typeChoices.js`
2669
2694
  if (!schemaFallingBack) {
2670
2695
  const specificSchemaObj = /** @type {import('zodexy').SzTuple} */ (
@@ -2676,7 +2701,7 @@ const arrayType = {
2676
2701
  }
2677
2702
  }
2678
2703
  }
2679
- } else if (!objectValue && specificSchemaObject) {
2704
+ } else if (!hasValue && specificSchemaObject) {
2680
2705
  switch (type) {
2681
2706
  case 'object': {
2682
2707
  // See comment referencing `arrayType.js` in `typeChoices.js`
@@ -106,7 +106,15 @@ const regexpType = {
106
106
  'Source ',
107
107
  ['input', {
108
108
  name: `${typeNamespace}-regexp`, type: 'text',
109
- value: value.source
109
+ value: value.source,
110
+ $on: {
111
+ input () {
112
+ types.validate({type: 'regexp', root});
113
+ },
114
+ change () {
115
+ types.validate({type: 'regexp', root});
116
+ }
117
+ }
110
118
  }]
111
119
  ]],
112
120
  ['br'],
@@ -133,6 +133,11 @@ const stringType = {
133
133
  return `Value doesn't match credit card pattern.`;
134
134
  }
135
135
  break;
136
+ case 'iban':
137
+ if (!regexes.iban.test(value)) {
138
+ return `Value doesn't match iban pattern.`;
139
+ }
140
+ break;
136
141
  case 'ip':
137
142
  switch ('version' in stringSchemaObject &&
138
143
  stringSchemaObject.version) {
@@ -166,7 +166,9 @@ function deriveXorBranchLabel (schemaObj, optText, idx) {
166
166
  return String(values[0]);
167
167
  }
168
168
  }
169
- if (schemaObj && schemaObj.type === 'object') {
169
+ if (schemaObj &&
170
+ (schemaObj.type === 'object' || schemaObj.type === 'properties')
171
+ ) {
170
172
  const {properties} = /** @type {import('zodexy').SzObject} */ (schemaObj);
171
173
  const keys = properties && typeof properties === 'object'
172
174
  ? Object.keys(properties)
@@ -471,7 +473,12 @@ export const buildTypeChoices = ({
471
473
  this.value = type;
472
474
  }
473
475
  this.$setStyles();
474
- this.$addAndValidateEditUI({baseValue, bringIntoFocus, avoidReport});
476
+ this.$addAndValidateEditUI({
477
+ baseValue,
478
+ bringIntoFocus,
479
+ schemaObject: specificSchema,
480
+ avoidReport
481
+ });
475
482
  },
476
483
  /**
477
484
  * @this {TypeChoicesElementAPI}
@@ -551,7 +558,7 @@ export const buildTypeChoices = ({
551
558
  typeNamespace,
552
559
  type: /** @type {import('./types.js').AvailableArbitraryType} */ (type),
553
560
  bringIntoFocus,
554
- hasValue: type === 'arrayNonindexKeys' && baseValue,
561
+ hasValue: baseValue !== undefined,
555
562
  value: baseValue,
556
563
  buildTypeChoices,
557
564
  format,
@@ -588,7 +595,7 @@ export const buildTypeChoices = ({
588
595
  });
589
596
  topRoot = this.$getTopRoot(); // May be existing now
590
597
  // Needed; Array/object ref somewhere could now be valid or invalid
591
- types.validateAllReferences({topRoot});
598
+ types.validateAllReferences({topRoot, avoidReport});
592
599
  },
593
600
 
594
601
  /**
@@ -719,10 +726,7 @@ export const buildTypeChoices = ({
719
726
  value = {};
720
727
  }
721
728
  try {
722
- const {
723
- rootUI: rootEditUI,
724
- specificSchemas
725
- } = await formats.getControlsForFormatAndValue(
729
+ const builtState = await formats.getControlsForFormatAndValue(
726
730
  types,
727
731
  format,
728
732
  value,
@@ -735,6 +739,10 @@ export const buildTypeChoices = ({
735
739
  types
736
740
  }
737
741
  );
742
+ const {
743
+ rootUI: rootEditUI,
744
+ specificSchemas
745
+ } = builtState;
738
746
  const type =
739
747
  Types.getTypeForRoot(/** @type {HTMLDivElement} */ (
740
748
  rootEditUI
@@ -749,6 +757,7 @@ export const buildTypeChoices = ({
749
757
  // We do actually want the first one
750
758
  specificSchema: specificSchemas?.[0]
751
759
  });
760
+ await builtState.whenBuilt;
752
761
  } catch (err) {
753
762
  /* istanbul ignore next -- At least some errors handled earlier */
754
763
  dialogs.alert({
package/src/types.js CHANGED
@@ -202,7 +202,8 @@ export const getPropertyValueFromLegend = (legend) => {
202
202
 
203
203
  /**
204
204
  * @typedef {(cfg: {
205
- * topRoot: RootElement
205
+ * topRoot: RootElement,
206
+ * avoidReport?: boolean
206
207
  * }) => void} ValidateAllReferences
207
208
  */
208
209
 
@@ -359,6 +360,7 @@ export const getPropertyValueFromLegend = (legend) => {
359
360
  * buildTypeChoices?: import('./typeChoices.js').BuildTypeChoices,
360
361
  * schemaContent?: import('./formats/schema.js').ZodexSchema
361
362
  * replaced?: any
363
+ * hasValue?: boolean
362
364
  * }) => JamilihArray} viewUI
363
365
  * @property {(info: {
364
366
  * value?: StructuredCloneValue,
@@ -374,7 +376,8 @@ export const getPropertyValueFromLegend = (legend) => {
374
376
  * topRoot?: HTMLDivElement
375
377
  * schemaContent?: import('./formats/schema.js').ZodexSchema,
376
378
  * specificSchemaObject?: import('./formats/schema.js').ZodexSchema,
377
- * schemaFallingBack?: boolean
379
+ * schemaFallingBack?: boolean,
380
+ * hasValue?: boolean
378
381
  * }) => JamilihArray} editUI
379
382
  * @property {(info: {root: HTMLDivElement}) =>
380
383
  * HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|
@@ -391,7 +394,8 @@ export const getPropertyValueFromLegend = (legend) => {
391
394
  * }} [validate] Message will be used if validity is false.
392
395
  * @property {(info: {
393
396
  * topRoot: HTMLDivElement,
394
- * types: Types
397
+ * types: Types,
398
+ * avoidReport?: boolean
395
399
  * }) => void} [validateAll] For
396
400
  * validation of array and object references only.
397
401
  * @property {{
@@ -717,6 +721,13 @@ class Types {
717
721
  // `record`/`tuple` are not shown as their own pull-down entries; they render
718
722
  // as `Object`/`Array` (their schema, incl. child descriptions, informs the
719
723
  // layout — see `arrayType.js`).
724
+ // `z.properties()` likewise renders through the `object` type/UI; when the
725
+ // schema supplies no label of its own, name it "Properties" so it is not
726
+ // shown as an indistinguishable "Object".
727
+ if (type === 'object' && schemaContent?.type === 'properties') {
728
+ optInfo[0] = 'Properties';
729
+ }
730
+
720
731
  const schemaContentLabel = resolveSchemaMeta(schemaContent).label;
721
732
  if (schemaContentLabel) {
722
733
  optInfo[0] = `${optInfo[0]} (${schemaContentLabel})`;
@@ -766,7 +777,7 @@ class Types {
766
777
  format, schemaContent,
767
778
  resultType, topRoot, bringIntoFocus, value,
768
779
  replaced,
769
- specificSchemaObject, schemaFallingBack,
780
+ specificSchemaObject, schemaFallingBack, hasValue,
770
781
  types: this
771
782
  }
772
783
  : {
@@ -774,7 +785,7 @@ class Types {
774
785
  format, schemaContent,
775
786
  resultType, topRoot, bringIntoFocus,
776
787
  replaced,
777
- specificSchemaObject, schemaFallingBack,
788
+ specificSchemaObject, schemaFallingBack, hasValue,
778
789
  types: this
779
790
  };
780
791
  const root = /** @type {HTMLDivElement} */ (jml(
@@ -796,7 +807,7 @@ class Types {
796
807
  }
797
808
 
798
809
  /** @type {ValidateAllReferences} */
799
- validateAllReferences ({topRoot}) {
810
+ validateAllReferences ({topRoot, avoidReport}) {
800
811
  /* istanbul ignore if -- Unreachable? */
801
812
  if (!topRoot) {
802
813
  console.log('No references present');
@@ -808,7 +819,7 @@ class Types {
808
819
  Object.values(this.availableTypes).forEach((typeObj) => {
809
820
  const typeObject = /** @type {TypeObject} */ (typeObj);
810
821
  if (typeObject.validateAll) {
811
- typeObject.validateAll({topRoot, types: this});
822
+ typeObject.validateAll({topRoot, types: this, avoidReport});
812
823
  }
813
824
  });
814
825
 
@@ -858,7 +869,7 @@ class Types {
858
869
  'message' in error
859
870
  ? error.message
860
871
  : undefined;
861
- if (errorMessage !== 'Not yet instantiated') {
872
+ if (errorMessage !== 'Not yet instantiated' && typeValidation.valid) {
862
873
  return false;
863
874
  }
864
875
  valueReady = false;
@@ -1051,6 +1051,26 @@ const filelist = {
1051
1051
  }
1052
1052
  };
1053
1053
 
1054
+ /* globals IDBKeyRange -- Polyfill needed */
1055
+
1056
+
1057
+ /**
1058
+ * @type {import('typeson').TypeSpecSet}
1059
+ */
1060
+ const idbkeyrange = {
1061
+ idbkeyrange: {
1062
+ test (x) {
1063
+ return toStringTag(x) === 'IDBKeyRange';
1064
+ },
1065
+ replace ({lower, upper, lowerOpen, upperOpen}) {
1066
+ return {lower, upper, lowerOpen, upperOpen};
1067
+ },
1068
+ revive ({lower, upper, lowerOpen, upperOpen}) {
1069
+ return IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen);
1070
+ }
1071
+ }
1072
+ };
1073
+
1054
1074
  /* globals document, OffscreenCanvas, createImageBitmap -- Polyfills */
1055
1075
  // `ImageBitmap` is browser / DOM specific. It also can only work
1056
1076
  // same-domain (or CORS)
@@ -1432,10 +1452,18 @@ const promise = {
1432
1452
  const quotaexceedederror = {
1433
1453
  quotaexceedederror: {
1434
1454
  test (x) { return toStringTag(x) === 'QuotaExceededError'; },
1435
- replace ({message, quota, requested}) {
1436
- return {message, quota, requested};
1455
+ replace ({
1456
+ message, quota, requested,
1457
+ cause, stack, fileName, lineNumber, columnNumber
1458
+ }) {
1459
+ return {
1460
+ message, quota, requested,
1461
+ cause, stack, fileName, lineNumber, columnNumber
1462
+ };
1437
1463
  },
1438
- revive ({message, quota, requested}) {
1464
+ revive (obj) {
1465
+ const {message, quota, requested} = obj;
1466
+
1439
1467
  /** @type {{quota?: number, requested?: number}} */
1440
1468
  const options = {};
1441
1469
  if (quota !== null && quota !== undefined) {
@@ -1444,7 +1472,26 @@ const quotaexceedederror = {
1444
1472
  if (requested !== null && requested !== undefined) {
1445
1473
  options.requested = requested;
1446
1474
  }
1447
- return new QuotaExceededError(message, options);
1475
+ const e = /**
1476
+ * @type {{
1477
+ * name: string,
1478
+ * cause: Error,
1479
+ * stack: string,
1480
+ * fileName?: string,
1481
+ * lineNumber?: import('typeson').Integer,
1482
+ * columnNumber?: import('typeson').Integer
1483
+ * }}
1484
+ */ (
1485
+ new QuotaExceededError(message, options)
1486
+ );
1487
+
1488
+ e.cause = obj.cause;
1489
+ e.stack = obj.stack;
1490
+ e.fileName = obj.fileName;
1491
+ e.lineNumber = obj.lineNumber;
1492
+ e.columnNumber = obj.columnNumber;
1493
+
1494
+ return e;
1448
1495
  }
1449
1496
  }
1450
1497
  };
@@ -1824,15 +1871,41 @@ const webtransporterror = {
1824
1871
  test (x) { return toStringTag(x) === 'WebTransportError'; },
1825
1872
  // Note that we can't support the `source` property (defaults
1826
1873
  // to `stream` instead of `session`)
1827
- replace ({message, streamErrorCode}) {
1828
- return {message, streamErrorCode};
1874
+ replace ({
1875
+ message, streamErrorCode,
1876
+ cause, stack, fileName, lineNumber, columnNumber
1877
+ }) {
1878
+ return {
1879
+ message, streamErrorCode,
1880
+ cause, stack, fileName, lineNumber, columnNumber
1881
+ };
1829
1882
  },
1830
- revive ({message, streamErrorCode}) {
1883
+ revive (obj) {
1884
+ const {message, streamErrorCode} = obj;
1831
1885
  // TS lib still models the older two-argument
1832
1886
  // `(message, options)` form; browsers implement a single
1833
1887
  // `init` object (which also carries `message`).
1834
- // @ts-expect-error - More recent API
1835
- return new WebTransportError({message, streamErrorCode});
1888
+ const e = /**
1889
+ * @type {{
1890
+ * name: string,
1891
+ * cause: Error,
1892
+ * stack: string,
1893
+ * fileName?: string,
1894
+ * lineNumber?: import('typeson').Integer,
1895
+ * columnNumber?: import('typeson').Integer
1896
+ * }}
1897
+ */ (
1898
+ // @ts-expect-error - More recent API
1899
+ new WebTransportError({message, streamErrorCode})
1900
+ );
1901
+
1902
+ e.cause = obj.cause;
1903
+ e.stack = obj.stack;
1904
+ e.fileName = obj.fileName;
1905
+ e.lineNumber = obj.lineNumber;
1906
+ e.columnNumber = obj.columnNumber;
1907
+
1908
+ return e;
1836
1909
  }
1837
1910
  }
1838
1911
  };
@@ -2256,5 +2329,5 @@ const universal = [
2256
2329
  // built-in into ecmasript standard.
2257
2330
  ];
2258
2331
 
2259
- export { c as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningForStorage, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, videoframe, webtransporterror };
2332
+ export { c as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, idbkeyrange, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningForStorage, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, videoframe, webtransporterror };
2260
2333
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
1
+ export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
@@ -1 +1 @@
1
- export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, } from "../core/index.js";
1
+ export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, } from "../core/index.js";
@@ -7,7 +7,7 @@ export * from "./compat.js";
7
7
  export type { infer } from "../core/index.js";
8
8
  export type { JSONType } from "../core/util.js";
9
9
  export type { CompileOptions } from "../core/index.js";
10
- export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
10
+ export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
11
11
  export { toJSONSchema } from "../core/json-schema-processors.js";
12
12
  export { fromJSONSchema } from "./from-json-schema.js";
13
13
  export { deepPartial } from "./deep-partial.js";
@@ -4,7 +4,7 @@ export * from "./checks.js";
4
4
  export * from "./errors.js";
5
5
  export * from "./parse.js";
6
6
  export * from "./compat.js";
7
- export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
7
+ export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
8
8
  export { toJSONSchema } from "../core/json-schema-processors.js";
9
9
  export { fromJSONSchema } from "./from-json-schema.js";
10
10
  export { deepPartial } from "./deep-partial.js";