@speclynx/apidom-ns-openapi-2 4.10.0 → 4.11.1

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,18 @@
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.11.1](https://github.com/speclynx/apidom/compare/v4.11.0...v4.11.1) (2026-06-10)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
9
+
10
+ # [4.11.0](https://github.com/speclynx/apidom/compare/v4.10.1...v4.11.0) (2026-06-10)
11
+
12
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
13
+
14
+ ## [4.10.1](https://github.com/speclynx/apidom/compare/v4.10.0...v4.10.1) (2026-05-20)
15
+
16
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
17
+
6
18
  # [4.10.0](https://github.com/speclynx/apidom/compare/v4.9.1...v4.10.0) (2026-05-12)
7
19
 
8
20
  **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
@@ -27823,6 +27823,14 @@ class Path {
27823
27823
  */
27824
27824
  inList;
27825
27825
 
27826
+ /**
27827
+ * True when this node is a non-descending revisit of an already-visited node
27828
+ * (only under skipVisited: 'enter-only'). Children are not traversed.
27829
+ * Set on both the enter and the matching leave phase, so it is meaningful
27830
+ * in either phase.
27831
+ */
27832
+ revisited = false;
27833
+
27826
27834
  /**
27827
27835
  * Internal state for traversal control.
27828
27836
  */
@@ -28407,6 +28415,10 @@ __webpack_require__.r(__webpack_exports__);
28407
28415
 
28408
28416
 
28409
28417
 
28418
+ /**
28419
+ * Controls handling of already-visited nodes during traversal.
28420
+ * @public
28421
+ */
28410
28422
  /**
28411
28423
  * Options for the traverse function.
28412
28424
  * @public
@@ -28414,6 +28426,12 @@ __webpack_require__.r(__webpack_exports__);
28414
28426
  // =============================================================================
28415
28427
  // Internal types for generator
28416
28428
  // =============================================================================
28429
+
28430
+ const normalizeSkipVisited = v => {
28431
+ if (v === true) return 'skip';
28432
+ if (v === false || v === undefined) return 'never';
28433
+ return v;
28434
+ };
28417
28435
  // =============================================================================
28418
28436
  // Core generator
28419
28437
  // =============================================================================
@@ -28431,7 +28449,7 @@ function* traverseGenerator(root, visitor, options) {
28431
28449
  mutationFn
28432
28450
  } = options;
28433
28451
  const keyMapIsFunction = typeof keyMap === 'function';
28434
- const visitedNodes = skipVisited ? new WeakSet() : null;
28452
+ const visitedNodes = skipVisited !== 'never' ? new WeakSet() : null;
28435
28453
  let stack;
28436
28454
  let inArray = Array.isArray(root);
28437
28455
  let keys = [root];
@@ -28446,6 +28464,7 @@ function* traverseGenerator(root, visitor, options) {
28446
28464
  index += 1;
28447
28465
  const isLeaving = index === keys.length;
28448
28466
  let key;
28467
+ let revisitNoDescend = false;
28449
28468
  const isEdited = isLeaving && edits.length !== 0;
28450
28469
  if (isLeaving) {
28451
28470
  key = ancestors.length === 0 ? undefined : currentPath?.key;
@@ -28487,6 +28506,7 @@ function* traverseGenerator(root, visitor, options) {
28487
28506
  edits = stack.edits;
28488
28507
  const parentInArray = stack.inArray;
28489
28508
  parentPath = stack.parentPath;
28509
+ revisitNoDescend = stack.revisitNoDescend;
28490
28510
  stack = stack.prev;
28491
28511
 
28492
28512
  // Push the edited node to parent's edits for propagation up the tree
@@ -28518,15 +28538,22 @@ function* traverseGenerator(root, visitor, options) {
28518
28538
  }
28519
28539
 
28520
28540
  // Skip already-visited nodes (handles DAG structures from cloneShallow)
28521
- if (skipVisited && !isLeaving) {
28541
+ if (skipVisited !== 'never' && !isLeaving) {
28522
28542
  if (visitedNodes.has(node)) {
28523
- continue;
28543
+ if (skipVisited === 'enter-only') {
28544
+ // fire enter/leave for this occurrence, but don't re-descend
28545
+ revisitNoDescend = true;
28546
+ } else {
28547
+ continue;
28548
+ }
28549
+ } else {
28550
+ visitedNodes.add(node);
28524
28551
  }
28525
- visitedNodes.add(node);
28526
28552
  }
28527
28553
 
28528
28554
  // Always create Path for the current node (needed for parentPath chain)
28529
28555
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
28556
+ currentPath.revisited = revisitNoDescend;
28530
28557
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
28531
28558
  if (visitFn) {
28532
28559
  // Assign state to visitor
@@ -28590,10 +28617,13 @@ function* traverseGenerator(root, visitor, options) {
28590
28617
  keys,
28591
28618
  edits,
28592
28619
  parentPath,
28620
+ revisitNoDescend,
28593
28621
  prev: stack
28594
28622
  };
28595
28623
  inArray = Array.isArray(node);
28596
- if (inArray) {
28624
+ if (revisitNoDescend) {
28625
+ keys = [];
28626
+ } else if (inArray) {
28597
28627
  keys = node;
28598
28628
  } else if (keyMapIsFunction) {
28599
28629
  keys = keyMap(node);
@@ -28668,7 +28698,7 @@ const traverse = (root, visitor, options = {}) => {
28668
28698
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
28669
28699
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
28670
28700
  detectCycles: options.detectCycles ?? true,
28671
- skipVisited: options.skipVisited ?? false,
28701
+ skipVisited: normalizeSkipVisited(options.skipVisited),
28672
28702
  mutable: options.mutable ?? false,
28673
28703
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
28674
28704
  };
@@ -28700,7 +28730,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
28700
28730
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
28701
28731
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
28702
28732
  detectCycles: options.detectCycles ?? true,
28703
- skipVisited: options.skipVisited ?? false,
28733
+ skipVisited: normalizeSkipVisited(options.skipVisited),
28704
28734
  mutable: options.mutable ?? false,
28705
28735
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
28706
28736
  };
@@ -29168,7 +29198,9 @@ mergeVisitors[Symbol.for('nodejs.util.promisify.custom')] = mergeVisitorsAsync;
29168
29198
  * @internal
29169
29199
  */
29170
29200
  function createPathProxy(originalPath, currentNode) {
29171
- return new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
29201
+ const proxy = new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
29202
+ proxy.revisited = originalPath.revisited;
29203
+ return proxy;
29172
29204
  }
29173
29205
 
29174
29206
  /***/ }