@speclynx/apidom-parser-adapter-json-schema-yaml-2020-12 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-json-schema-yaml-2020-12
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-json-schema-yaml-2020-12
@@ -22667,7 +22667,7 @@ function doubleQuotedValue(source, onError) {
22667
22667
  next = source[++i + 1];
22668
22668
  }
22669
22669
  else if (next === 'x' || next === 'u' || next === 'U') {
22670
- const length = { x: 2, u: 4, U: 8 }[next];
22670
+ const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
22671
22671
  res += parseCharCode(source, i + 1, length, onError);
22672
22672
  i += length;
22673
22673
  }
@@ -22737,12 +22737,14 @@ function parseCharCode(source, offset, length, onError) {
22737
22737
  const cc = source.substr(offset, length);
22738
22738
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
22739
22739
  const code = ok ? parseInt(cc, 16) : NaN;
22740
- if (isNaN(code)) {
22740
+ try {
22741
+ return String.fromCodePoint(code);
22742
+ }
22743
+ catch {
22741
22744
  const raw = source.substr(offset - 2, length + 2);
22742
22745
  onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
22743
22746
  return raw;
22744
22747
  }
22745
- return String.fromCodePoint(code);
22746
22748
  }
22747
22749
 
22748
22750
 
@@ -24055,6 +24057,8 @@ class Alias extends _Node_js__WEBPACK_IMPORTED_MODULE_3__.NodeBase {
24055
24057
  * instance of the `source` anchor before this node.
24056
24058
  */
24057
24059
  resolve(doc, ctx) {
24060
+ if (ctx?.maxAliasCount === 0)
24061
+ throw new ReferenceError('Alias resolution is disabled');
24058
24062
  let nodes;
24059
24063
  if (ctx?.aliasResolveCache) {
24060
24064
  nodes = ctx.aliasResolveCache;
@@ -28234,18 +28238,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
28234
28238
  merge.identify(key.value))) &&
28235
28239
  ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
28236
28240
  function addMergeToJSMap(ctx, map, value) {
28237
- value = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28238
- if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(value))
28239
- for (const it of value.items)
28241
+ const source = resolveAliasValue(ctx, value);
28242
+ if ((0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isSeq)(source))
28243
+ for (const it of source.items)
28240
28244
  mergeValue(ctx, map, it);
28241
- else if (Array.isArray(value))
28242
- for (const it of value)
28245
+ else if (Array.isArray(source))
28246
+ for (const it of source)
28243
28247
  mergeValue(ctx, map, it);
28244
28248
  else
28245
- mergeValue(ctx, map, value);
28249
+ mergeValue(ctx, map, source);
28246
28250
  }
28247
28251
  function mergeValue(ctx, map, value) {
28248
- const source = ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc) : value;
28252
+ const source = resolveAliasValue(ctx, value);
28249
28253
  if (!(0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isMap)(source))
28250
28254
  throw new Error('Merge sources must be maps or map aliases');
28251
28255
  const srcMap = source.toJSON(null, ctx, Map);
@@ -28268,6 +28272,9 @@ function mergeValue(ctx, map, value) {
28268
28272
  }
28269
28273
  return map;
28270
28274
  }
28275
+ function resolveAliasValue(ctx, value) {
28276
+ return ctx && (0,_nodes_identity_js__WEBPACK_IMPORTED_MODULE_0__.isAlias)(value) ? value.resolve(ctx.doc, ctx) : value;
28277
+ }
28271
28278
 
28272
28279
 
28273
28280
 
@@ -29378,7 +29385,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
29378
29385
  if (!format &&
29379
29386
  minFractionDigits &&
29380
29387
  (!tag || tag === 'tag:yaml.org,2002:float') &&
29381
- /^\d/.test(n)) {
29388
+ /^-?\d/.test(n) &&
29389
+ !n.includes('e')) {
29382
29390
  let i = n.indexOf('.');
29383
29391
  if (i < 0) {
29384
29392
  i = n.length;