@speclynx/apidom-parser-adapter-openapi-yaml-3-0 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-openapi-yaml-3-0
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-openapi-yaml-3-0
@@ -22795,7 +22795,7 @@ function doubleQuotedValue(source, onError) {
22795
22795
  next = source[++i + 1];
22796
22796
  }
22797
22797
  else if (next === 'x' || next === 'u' || next === 'U') {
22798
- const length = { x: 2, u: 4, U: 8 }[next];
22798
+ const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
22799
22799
  res += parseCharCode(source, i + 1, length, onError);
22800
22800
  i += length;
22801
22801
  }
@@ -22865,12 +22865,14 @@ function parseCharCode(source, offset, length, onError) {
22865
22865
  const cc = source.substr(offset, length);
22866
22866
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
22867
22867
  const code = ok ? parseInt(cc, 16) : NaN;
22868
- if (isNaN(code)) {
22868
+ try {
22869
+ return String.fromCodePoint(code);
22870
+ }
22871
+ catch {
22869
22872
  const raw = source.substr(offset - 2, length + 2);
22870
22873
  onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
22871
22874
  return raw;
22872
22875
  }
22873
- return String.fromCodePoint(code);
22874
22876
  }
22875
22877
 
22876
22878
 
@@ -24183,6 +24185,8 @@ class Alias extends _Node_js__WEBPACK_IMPORTED_MODULE_3__.NodeBase {
24183
24185
  * instance of the `source` anchor before this node.
24184
24186
  */
24185
24187
  resolve(doc, ctx) {
24188
+ if (ctx?.maxAliasCount === 0)
24189
+ throw new ReferenceError('Alias resolution is disabled');
24186
24190
  let nodes;
24187
24191
  if (ctx?.aliasResolveCache) {
24188
24192
  nodes = ctx.aliasResolveCache;
@@ -28362,18 +28366,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
28362
28366
  merge.identify(key.value))) &&
28363
28367
  ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
28364
28368
  function addMergeToJSMap(ctx, map, value) {
28365
- value = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28366
- if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(value))
28367
- for (const it of value.items)
28369
+ const source = resolveAliasValue(ctx, value);
28370
+ if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(source))
28371
+ for (const it of source.items)
28368
28372
  mergeValue(ctx, map, it);
28369
- else if (Array.isArray(value))
28370
- for (const it of value)
28373
+ else if (Array.isArray(source))
28374
+ for (const it of source)
28371
28375
  mergeValue(ctx, map, it);
28372
28376
  else
28373
- mergeValue(ctx, map, value);
28377
+ mergeValue(ctx, map, source);
28374
28378
  }
28375
28379
  function mergeValue(ctx, map, value) {
28376
- const source = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28380
+ const source = resolveAliasValue(ctx, value);
28377
28381
  if (!(0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isMap)(source))
28378
28382
  throw new Error('Merge sources must be maps or map aliases');
28379
28383
  const srcMap = source.toJSON(null, ctx, Map);
@@ -28396,6 +28400,9 @@ function mergeValue(ctx, map, value) {
28396
28400
  }
28397
28401
  return map;
28398
28402
  }
28403
+ function resolveAliasValue(ctx, value) {
28404
+ return ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc, ctx) : value;
28405
+ }
28399
28406
 
28400
28407
 
28401
28408
 
@@ -29506,7 +29513,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
29506
29513
  if (!format &&
29507
29514
  minFractionDigits &&
29508
29515
  (!tag || tag === 'tag:yaml.org,2002:float') &&
29509
- /^\d/.test(n)) {
29516
+ /^-?\d/.test(n) &&
29517
+ !n.includes('e')) {
29510
29518
  let i = n.indexOf('.');
29511
29519
  if (i < 0) {
29512
29520
  i = n.length;