@speclynx/apidom-parser-adapter-asyncapi-yaml-2 4.9.1 → 4.10.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.10.0](https://github.com/speclynx/apidom/compare/v4.9.1...v4.10.0) (2026-05-12)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-asyncapi-yaml-2
9
+
6
10
  ## [4.9.1](https://github.com/speclynx/apidom/compare/v4.9.0...v4.9.1) (2026-04-21)
7
11
 
8
12
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-asyncapi-yaml-2
@@ -22871,7 +22871,7 @@ function doubleQuotedValue(source, onError) {
22871
22871
  next = source[++i + 1];
22872
22872
  }
22873
22873
  else if (next === 'x' || next === 'u' || next === 'U') {
22874
- const length = { x: 2, u: 4, U: 8 }[next];
22874
+ const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
22875
22875
  res += parseCharCode(source, i + 1, length, onError);
22876
22876
  i += length;
22877
22877
  }
@@ -22941,12 +22941,14 @@ function parseCharCode(source, offset, length, onError) {
22941
22941
  const cc = source.substr(offset, length);
22942
22942
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
22943
22943
  const code = ok ? parseInt(cc, 16) : NaN;
22944
- if (isNaN(code)) {
22944
+ try {
22945
+ return String.fromCodePoint(code);
22946
+ }
22947
+ catch {
22945
22948
  const raw = source.substr(offset - 2, length + 2);
22946
22949
  onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
22947
22950
  return raw;
22948
22951
  }
22949
- return String.fromCodePoint(code);
22950
22952
  }
22951
22953
 
22952
22954
 
@@ -24259,6 +24261,8 @@ class Alias extends _Node_js__WEBPACK_IMPORTED_MODULE_3__.NodeBase {
24259
24261
  * instance of the `source` anchor before this node.
24260
24262
  */
24261
24263
  resolve(doc, ctx) {
24264
+ if (ctx?.maxAliasCount === 0)
24265
+ throw new ReferenceError('Alias resolution is disabled');
24262
24266
  let nodes;
24263
24267
  if (ctx?.aliasResolveCache) {
24264
24268
  nodes = ctx.aliasResolveCache;
@@ -28438,18 +28442,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
28438
28442
  merge.identify(key.value))) &&
28439
28443
  ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
28440
28444
  function addMergeToJSMap(ctx, map, value) {
28441
- value = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28442
- if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(value))
28443
- for (const it of value.items)
28445
+ const source = resolveAliasValue(ctx, value);
28446
+ if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(source))
28447
+ for (const it of source.items)
28444
28448
  mergeValue(ctx, map, it);
28445
- else if (Array.isArray(value))
28446
- for (const it of value)
28449
+ else if (Array.isArray(source))
28450
+ for (const it of source)
28447
28451
  mergeValue(ctx, map, it);
28448
28452
  else
28449
- mergeValue(ctx, map, value);
28453
+ mergeValue(ctx, map, source);
28450
28454
  }
28451
28455
  function mergeValue(ctx, map, value) {
28452
- const source = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28456
+ const source = resolveAliasValue(ctx, value);
28453
28457
  if (!(0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isMap)(source))
28454
28458
  throw new Error('Merge sources must be maps or map aliases');
28455
28459
  const srcMap = source.toJSON(null, ctx, Map);
@@ -28472,6 +28476,9 @@ function mergeValue(ctx, map, value) {
28472
28476
  }
28473
28477
  return map;
28474
28478
  }
28479
+ function resolveAliasValue(ctx, value) {
28480
+ return ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc, ctx) : value;
28481
+ }
28475
28482
 
28476
28483
 
28477
28484
 
@@ -29582,7 +29589,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
29582
29589
  if (!format &&
29583
29590
  minFractionDigits &&
29584
29591
  (!tag || tag === 'tag:yaml.org,2002:float') &&
29585
- /^\d/.test(n)) {
29592
+ /^-?\d/.test(n) &&
29593
+ !n.includes('e')) {
29586
29594
  let i = n.indexOf('.');
29587
29595
  if (i < 0) {
29588
29596
  i = n.length;