@speclynx/apidom-parser-adapter-yaml-1-2 4.9.0 → 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,14 @@
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-yaml-1-2
9
+
10
+ ## [4.9.1](https://github.com/speclynx/apidom/compare/v4.9.0...v4.9.1) (2026-04-21)
11
+
12
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
13
+
6
14
  # [4.9.0](https://github.com/speclynx/apidom/compare/v4.8.0...v4.9.0) (2026-04-17)
7
15
 
8
16
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
@@ -13532,7 +13532,7 @@ function doubleQuotedValue(source, onError) {
13532
13532
  next = source[++i + 1];
13533
13533
  }
13534
13534
  else if (next === 'x' || next === 'u' || next === 'U') {
13535
- const length = { x: 2, u: 4, U: 8 }[next];
13535
+ const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
13536
13536
  res += parseCharCode(source, i + 1, length, onError);
13537
13537
  i += length;
13538
13538
  }
@@ -13602,12 +13602,14 @@ function parseCharCode(source, offset, length, onError) {
13602
13602
  const cc = source.substr(offset, length);
13603
13603
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
13604
13604
  const code = ok ? parseInt(cc, 16) : NaN;
13605
- if (isNaN(code)) {
13605
+ try {
13606
+ return String.fromCodePoint(code);
13607
+ }
13608
+ catch {
13606
13609
  const raw = source.substr(offset - 2, length + 2);
13607
13610
  onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
13608
13611
  return raw;
13609
13612
  }
13610
- return String.fromCodePoint(code);
13611
13613
  }
13612
13614
 
13613
13615
 
@@ -14920,6 +14922,8 @@ class Alias extends _Node_js__WEBPACK_IMPORTED_MODULE_3__.NodeBase {
14920
14922
  * instance of the `source` anchor before this node.
14921
14923
  */
14922
14924
  resolve(doc, ctx) {
14925
+ if (ctx?.maxAliasCount === 0)
14926
+ throw new ReferenceError('Alias resolution is disabled');
14923
14927
  let nodes;
14924
14928
  if (ctx?.aliasResolveCache) {
14925
14929
  nodes = ctx.aliasResolveCache;
@@ -19099,18 +19103,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
19099
19103
  merge.identify(key.value))) &&
19100
19104
  ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
19101
19105
  function addMergeToJSMap(ctx, map, value) {
19102
- value = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
19103
- if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(value))
19104
- for (const it of value.items)
19106
+ const source = resolveAliasValue(ctx, value);
19107
+ if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(source))
19108
+ for (const it of source.items)
19105
19109
  mergeValue(ctx, map, it);
19106
- else if (Array.isArray(value))
19107
- for (const it of value)
19110
+ else if (Array.isArray(source))
19111
+ for (const it of source)
19108
19112
  mergeValue(ctx, map, it);
19109
19113
  else
19110
- mergeValue(ctx, map, value);
19114
+ mergeValue(ctx, map, source);
19111
19115
  }
19112
19116
  function mergeValue(ctx, map, value) {
19113
- const source = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
19117
+ const source = resolveAliasValue(ctx, value);
19114
19118
  if (!(0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isMap)(source))
19115
19119
  throw new Error('Merge sources must be maps or map aliases');
19116
19120
  const srcMap = source.toJSON(null, ctx, Map);
@@ -19133,6 +19137,9 @@ function mergeValue(ctx, map, value) {
19133
19137
  }
19134
19138
  return map;
19135
19139
  }
19140
+ function resolveAliasValue(ctx, value) {
19141
+ return ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc, ctx) : value;
19142
+ }
19136
19143
 
19137
19144
 
19138
19145
 
@@ -20243,7 +20250,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
20243
20250
  if (!format &&
20244
20251
  minFractionDigits &&
20245
20252
  (!tag || tag === 'tag:yaml.org,2002:float') &&
20246
- /^\d/.test(n)) {
20253
+ /^-?\d/.test(n) &&
20254
+ !n.includes('e')) {
20247
20255
  let i = n.indexOf('.');
20248
20256
  if (i < 0) {
20249
20257
  i = n.length;