@speclynx/apidom-parser-adapter-overlay-yaml-1 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-overlay-yaml-1
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-overlay-yaml-1
@@ -21915,7 +21915,7 @@ function doubleQuotedValue(source, onError) {
21915
21915
  next = source[++i + 1];
21916
21916
  }
21917
21917
  else if (next === 'x' || next === 'u' || next === 'U') {
21918
- const length = { x: 2, u: 4, U: 8 }[next];
21918
+ const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
21919
21919
  res += parseCharCode(source, i + 1, length, onError);
21920
21920
  i += length;
21921
21921
  }
@@ -21985,12 +21985,14 @@ function parseCharCode(source, offset, length, onError) {
21985
21985
  const cc = source.substr(offset, length);
21986
21986
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
21987
21987
  const code = ok ? parseInt(cc, 16) : NaN;
21988
- if (isNaN(code)) {
21988
+ try {
21989
+ return String.fromCodePoint(code);
21990
+ }
21991
+ catch {
21989
21992
  const raw = source.substr(offset - 2, length + 2);
21990
21993
  onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
21991
21994
  return raw;
21992
21995
  }
21993
- return String.fromCodePoint(code);
21994
21996
  }
21995
21997
 
21996
21998
 
@@ -23303,6 +23305,8 @@ class Alias extends _Node_js__WEBPACK_IMPORTED_MODULE_3__.NodeBase {
23303
23305
  * instance of the `source` anchor before this node.
23304
23306
  */
23305
23307
  resolve(doc, ctx) {
23308
+ if (ctx?.maxAliasCount === 0)
23309
+ throw new ReferenceError('Alias resolution is disabled');
23306
23310
  let nodes;
23307
23311
  if (ctx?.aliasResolveCache) {
23308
23312
  nodes = ctx.aliasResolveCache;
@@ -27482,18 +27486,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
27482
27486
  merge.identify(key.value))) &&
27483
27487
  ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
27484
27488
  function addMergeToJSMap(ctx, map, value) {
27485
- value = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
27486
- if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(value))
27487
- for (const it of value.items)
27489
+ const source = resolveAliasValue(ctx, value);
27490
+ if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(source))
27491
+ for (const it of source.items)
27488
27492
  mergeValue(ctx, map, it);
27489
- else if (Array.isArray(value))
27490
- for (const it of value)
27493
+ else if (Array.isArray(source))
27494
+ for (const it of source)
27491
27495
  mergeValue(ctx, map, it);
27492
27496
  else
27493
- mergeValue(ctx, map, value);
27497
+ mergeValue(ctx, map, source);
27494
27498
  }
27495
27499
  function mergeValue(ctx, map, value) {
27496
- const source = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
27500
+ const source = resolveAliasValue(ctx, value);
27497
27501
  if (!(0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isMap)(source))
27498
27502
  throw new Error('Merge sources must be maps or map aliases');
27499
27503
  const srcMap = source.toJSON(null, ctx, Map);
@@ -27516,6 +27520,9 @@ function mergeValue(ctx, map, value) {
27516
27520
  }
27517
27521
  return map;
27518
27522
  }
27523
+ function resolveAliasValue(ctx, value) {
27524
+ return ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc, ctx) : value;
27525
+ }
27519
27526
 
27520
27527
 
27521
27528
 
@@ -28626,7 +28633,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
28626
28633
  if (!format &&
28627
28634
  minFractionDigits &&
28628
28635
  (!tag || tag === 'tag:yaml.org,2002:float') &&
28629
- /^\d/.test(n)) {
28636
+ /^-?\d/.test(n) &&
28637
+ !n.includes('e')) {
28630
28638
  let i = n.indexOf('.');
28631
28639
  if (i < 0) {
28632
28640
  i = n.length;