@speclynx/apidom-parser-adapter-json-schema-json-2020-12 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-json-schema-json-2020-12
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-json-schema-json-2020-12
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-json-schema-json-2020-12
@@ -28967,10 +28967,12 @@ function* traverseGenerator(root, visitor, options) {
28967
28967
  nodePredicate,
28968
28968
  nodeCloneFn,
28969
28969
  detectCycles,
28970
+ skipVisited,
28970
28971
  mutable,
28971
28972
  mutationFn
28972
28973
  } = options;
28973
28974
  const keyMapIsFunction = typeof keyMap === 'function';
28975
+ const visitedNodes = skipVisited ? new WeakSet() : null;
28974
28976
  let stack;
28975
28977
  let inArray = Array.isArray(root);
28976
28978
  let keys = [root];
@@ -29056,6 +29058,14 @@ function* traverseGenerator(root, visitor, options) {
29056
29058
  continue;
29057
29059
  }
29058
29060
 
29061
+ // Skip already-visited nodes (handles DAG structures from cloneShallow)
29062
+ if (skipVisited && !isLeaving) {
29063
+ if (visitedNodes.has(node)) {
29064
+ continue;
29065
+ }
29066
+ visitedNodes.add(node);
29067
+ }
29068
+
29059
29069
  // Always create Path for the current node (needed for parentPath chain)
29060
29070
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
29061
29071
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
@@ -29076,11 +29086,6 @@ function* traverseGenerator(root, visitor, options) {
29076
29086
  if (currentPath.shouldStop) {
29077
29087
  break;
29078
29088
  }
29079
- if (currentPath.shouldSkip) {
29080
- if (!isLeaving) {
29081
- continue;
29082
- }
29083
- }
29084
29089
  if (currentPath.removed) {
29085
29090
  edits.push([key, null]);
29086
29091
  if (!isLeaving) {
@@ -29090,12 +29095,19 @@ function* traverseGenerator(root, visitor, options) {
29090
29095
  const replacement = currentPath._getReplacementNode();
29091
29096
  edits.push([key, replacement]);
29092
29097
  if (!isLeaving) {
29098
+ if (currentPath.shouldSkip) {
29099
+ continue;
29100
+ }
29093
29101
  if (nodePredicate(replacement)) {
29094
29102
  node = replacement;
29095
29103
  } else {
29096
29104
  continue;
29097
29105
  }
29098
29106
  }
29107
+ } else if (currentPath.shouldSkip) {
29108
+ if (!isLeaving) {
29109
+ continue;
29110
+ }
29099
29111
  } else if (result !== undefined) {
29100
29112
  // Support return value replacement for backwards compatibility
29101
29113
  edits.push([key, result]);
@@ -29197,6 +29209,7 @@ const traverse = (root, visitor, options = {}) => {
29197
29209
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
29198
29210
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
29199
29211
  detectCycles: options.detectCycles ?? true,
29212
+ skipVisited: options.skipVisited ?? false,
29200
29213
  mutable: options.mutable ?? false,
29201
29214
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
29202
29215
  };
@@ -29228,6 +29241,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
29228
29241
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
29229
29242
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
29230
29243
  detectCycles: options.detectCycles ?? true,
29244
+ skipVisited: options.skipVisited ?? false,
29231
29245
  mutable: options.mutable ?? false,
29232
29246
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
29233
29247
  };