@speclynx/apidom-parser-adapter-openapi-json-2 4.7.0 → 4.8.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.8.0](https://github.com/speclynx/apidom/compare/v4.7.1...v4.8.0) (2026-04-17)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-json-2
9
+
10
+ ## [4.7.1](https://github.com/speclynx/apidom/compare/v4.7.0...v4.7.1) (2026-04-16)
11
+
12
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-json-2
13
+
6
14
  # [4.7.0](https://github.com/speclynx/apidom/compare/v4.6.0...v4.7.0) (2026-04-12)
7
15
 
8
16
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-json-2
@@ -32577,10 +32577,12 @@ function* traverseGenerator(root, visitor, options) {
32577
32577
  nodePredicate,
32578
32578
  nodeCloneFn,
32579
32579
  detectCycles,
32580
+ skipVisited,
32580
32581
  mutable,
32581
32582
  mutationFn
32582
32583
  } = options;
32583
32584
  const keyMapIsFunction = typeof keyMap === 'function';
32585
+ const visitedNodes = skipVisited ? new WeakSet() : null;
32584
32586
  let stack;
32585
32587
  let inArray = Array.isArray(root);
32586
32588
  let keys = [root];
@@ -32666,6 +32668,14 @@ function* traverseGenerator(root, visitor, options) {
32666
32668
  continue;
32667
32669
  }
32668
32670
 
32671
+ // Skip already-visited nodes (handles DAG structures from cloneShallow)
32672
+ if (skipVisited && !isLeaving) {
32673
+ if (visitedNodes.has(node)) {
32674
+ continue;
32675
+ }
32676
+ visitedNodes.add(node);
32677
+ }
32678
+
32669
32679
  // Always create Path for the current node (needed for parentPath chain)
32670
32680
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
32671
32681
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
@@ -32686,11 +32696,6 @@ function* traverseGenerator(root, visitor, options) {
32686
32696
  if (currentPath.shouldStop) {
32687
32697
  break;
32688
32698
  }
32689
- if (currentPath.shouldSkip) {
32690
- if (!isLeaving) {
32691
- continue;
32692
- }
32693
- }
32694
32699
  if (currentPath.removed) {
32695
32700
  edits.push([key, null]);
32696
32701
  if (!isLeaving) {
@@ -32700,12 +32705,19 @@ function* traverseGenerator(root, visitor, options) {
32700
32705
  const replacement = currentPath._getReplacementNode();
32701
32706
  edits.push([key, replacement]);
32702
32707
  if (!isLeaving) {
32708
+ if (currentPath.shouldSkip) {
32709
+ continue;
32710
+ }
32703
32711
  if (nodePredicate(replacement)) {
32704
32712
  node = replacement;
32705
32713
  } else {
32706
32714
  continue;
32707
32715
  }
32708
32716
  }
32717
+ } else if (currentPath.shouldSkip) {
32718
+ if (!isLeaving) {
32719
+ continue;
32720
+ }
32709
32721
  } else if (result !== undefined) {
32710
32722
  // Support return value replacement for backwards compatibility
32711
32723
  edits.push([key, result]);
@@ -32807,6 +32819,7 @@ const traverse = (root, visitor, options = {}) => {
32807
32819
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
32808
32820
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
32809
32821
  detectCycles: options.detectCycles ?? true,
32822
+ skipVisited: options.skipVisited ?? false,
32810
32823
  mutable: options.mutable ?? false,
32811
32824
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
32812
32825
  };
@@ -32838,6 +32851,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
32838
32851
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
32839
32852
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
32840
32853
  detectCycles: options.detectCycles ?? true,
32854
+ skipVisited: options.skipVisited ?? false,
32841
32855
  mutable: options.mutable ?? false,
32842
32856
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
32843
32857
  };