@speclynx/apidom-ns-openapi-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-ns-openapi-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-ns-openapi-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-ns-openapi-2
@@ -28424,10 +28424,12 @@ function* traverseGenerator(root, visitor, options) {
28424
28424
  nodePredicate,
28425
28425
  nodeCloneFn,
28426
28426
  detectCycles,
28427
+ skipVisited,
28427
28428
  mutable,
28428
28429
  mutationFn
28429
28430
  } = options;
28430
28431
  const keyMapIsFunction = typeof keyMap === 'function';
28432
+ const visitedNodes = skipVisited ? new WeakSet() : null;
28431
28433
  let stack;
28432
28434
  let inArray = Array.isArray(root);
28433
28435
  let keys = [root];
@@ -28513,6 +28515,14 @@ function* traverseGenerator(root, visitor, options) {
28513
28515
  continue;
28514
28516
  }
28515
28517
 
28518
+ // Skip already-visited nodes (handles DAG structures from cloneShallow)
28519
+ if (skipVisited && !isLeaving) {
28520
+ if (visitedNodes.has(node)) {
28521
+ continue;
28522
+ }
28523
+ visitedNodes.add(node);
28524
+ }
28525
+
28516
28526
  // Always create Path for the current node (needed for parentPath chain)
28517
28527
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
28518
28528
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
@@ -28533,11 +28543,6 @@ function* traverseGenerator(root, visitor, options) {
28533
28543
  if (currentPath.shouldStop) {
28534
28544
  break;
28535
28545
  }
28536
- if (currentPath.shouldSkip) {
28537
- if (!isLeaving) {
28538
- continue;
28539
- }
28540
- }
28541
28546
  if (currentPath.removed) {
28542
28547
  edits.push([key, null]);
28543
28548
  if (!isLeaving) {
@@ -28547,12 +28552,19 @@ function* traverseGenerator(root, visitor, options) {
28547
28552
  const replacement = currentPath._getReplacementNode();
28548
28553
  edits.push([key, replacement]);
28549
28554
  if (!isLeaving) {
28555
+ if (currentPath.shouldSkip) {
28556
+ continue;
28557
+ }
28550
28558
  if (nodePredicate(replacement)) {
28551
28559
  node = replacement;
28552
28560
  } else {
28553
28561
  continue;
28554
28562
  }
28555
28563
  }
28564
+ } else if (currentPath.shouldSkip) {
28565
+ if (!isLeaving) {
28566
+ continue;
28567
+ }
28556
28568
  } else if (result !== undefined) {
28557
28569
  // Support return value replacement for backwards compatibility
28558
28570
  edits.push([key, result]);
@@ -28654,6 +28666,7 @@ const traverse = (root, visitor, options = {}) => {
28654
28666
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
28655
28667
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
28656
28668
  detectCycles: options.detectCycles ?? true,
28669
+ skipVisited: options.skipVisited ?? false,
28657
28670
  mutable: options.mutable ?? false,
28658
28671
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
28659
28672
  };
@@ -28685,6 +28698,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
28685
28698
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
28686
28699
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
28687
28700
  detectCycles: options.detectCycles ?? true,
28701
+ skipVisited: options.skipVisited ?? false,
28688
28702
  mutable: options.mutable ?? false,
28689
28703
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
28690
28704
  };