@speclynx/apidom-ns-json-schema-draft-7 4.10.1 → 4.12.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,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.12.0](https://github.com/speclynx/apidom/compare/v4.11.1...v4.12.0) (2026-06-23)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-ns-json-schema-draft-7
9
+
10
+ ## [4.11.1](https://github.com/speclynx/apidom/compare/v4.11.0...v4.11.1) (2026-06-10)
11
+
12
+ **Note:** Version bump only for package @speclynx/apidom-ns-json-schema-draft-7
13
+
14
+ # [4.11.0](https://github.com/speclynx/apidom/compare/v4.10.1...v4.11.0) (2026-06-10)
15
+
16
+ **Note:** Version bump only for package @speclynx/apidom-ns-json-schema-draft-7
17
+
6
18
  ## [4.10.1](https://github.com/speclynx/apidom/compare/v4.10.0...v4.10.1) (2026-05-20)
7
19
 
8
20
  **Note:** Version bump only for package @speclynx/apidom-ns-json-schema-draft-7
@@ -22433,6 +22433,14 @@ class Path {
22433
22433
  */
22434
22434
  inList;
22435
22435
 
22436
+ /**
22437
+ * True when this node is a non-descending revisit of an already-visited node
22438
+ * (only under skipVisited: 'enter-only'). Children are not traversed.
22439
+ * Set on both the enter and the matching leave phase, so it is meaningful
22440
+ * in either phase.
22441
+ */
22442
+ revisited = false;
22443
+
22436
22444
  /**
22437
22445
  * Internal state for traversal control.
22438
22446
  */
@@ -23017,6 +23025,10 @@ __webpack_require__.r(__webpack_exports__);
23017
23025
 
23018
23026
 
23019
23027
 
23028
+ /**
23029
+ * Controls handling of already-visited nodes during traversal.
23030
+ * @public
23031
+ */
23020
23032
  /**
23021
23033
  * Options for the traverse function.
23022
23034
  * @public
@@ -23024,6 +23036,12 @@ __webpack_require__.r(__webpack_exports__);
23024
23036
  // =============================================================================
23025
23037
  // Internal types for generator
23026
23038
  // =============================================================================
23039
+
23040
+ const normalizeSkipVisited = v => {
23041
+ if (v === true) return 'skip';
23042
+ if (v === false || v === undefined) return 'never';
23043
+ return v;
23044
+ };
23027
23045
  // =============================================================================
23028
23046
  // Core generator
23029
23047
  // =============================================================================
@@ -23041,7 +23059,7 @@ function* traverseGenerator(root, visitor, options) {
23041
23059
  mutationFn
23042
23060
  } = options;
23043
23061
  const keyMapIsFunction = typeof keyMap === 'function';
23044
- const visitedNodes = skipVisited ? new WeakSet() : null;
23062
+ const visitedNodes = skipVisited !== 'never' ? new WeakSet() : null;
23045
23063
  let stack;
23046
23064
  let inArray = Array.isArray(root);
23047
23065
  let keys = [root];
@@ -23056,6 +23074,7 @@ function* traverseGenerator(root, visitor, options) {
23056
23074
  index += 1;
23057
23075
  const isLeaving = index === keys.length;
23058
23076
  let key;
23077
+ let revisitNoDescend = false;
23059
23078
  const isEdited = isLeaving && edits.length !== 0;
23060
23079
  if (isLeaving) {
23061
23080
  key = ancestors.length === 0 ? undefined : currentPath?.key;
@@ -23097,6 +23116,7 @@ function* traverseGenerator(root, visitor, options) {
23097
23116
  edits = stack.edits;
23098
23117
  const parentInArray = stack.inArray;
23099
23118
  parentPath = stack.parentPath;
23119
+ revisitNoDescend = stack.revisitNoDescend;
23100
23120
  stack = stack.prev;
23101
23121
 
23102
23122
  // Push the edited node to parent's edits for propagation up the tree
@@ -23128,15 +23148,22 @@ function* traverseGenerator(root, visitor, options) {
23128
23148
  }
23129
23149
 
23130
23150
  // Skip already-visited nodes (handles DAG structures from cloneShallow)
23131
- if (skipVisited && !isLeaving) {
23151
+ if (skipVisited !== 'never' && !isLeaving) {
23132
23152
  if (visitedNodes.has(node)) {
23133
- continue;
23153
+ if (skipVisited === 'enter-only') {
23154
+ // fire enter/leave for this occurrence, but don't re-descend
23155
+ revisitNoDescend = true;
23156
+ } else {
23157
+ continue;
23158
+ }
23159
+ } else {
23160
+ visitedNodes.add(node);
23134
23161
  }
23135
- visitedNodes.add(node);
23136
23162
  }
23137
23163
 
23138
23164
  // Always create Path for the current node (needed for parentPath chain)
23139
23165
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
23166
+ currentPath.revisited = revisitNoDescend;
23140
23167
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
23141
23168
  if (visitFn) {
23142
23169
  // Assign state to visitor
@@ -23200,10 +23227,13 @@ function* traverseGenerator(root, visitor, options) {
23200
23227
  keys,
23201
23228
  edits,
23202
23229
  parentPath,
23230
+ revisitNoDescend,
23203
23231
  prev: stack
23204
23232
  };
23205
23233
  inArray = Array.isArray(node);
23206
- if (inArray) {
23234
+ if (revisitNoDescend) {
23235
+ keys = [];
23236
+ } else if (inArray) {
23207
23237
  keys = node;
23208
23238
  } else if (keyMapIsFunction) {
23209
23239
  keys = keyMap(node);
@@ -23278,7 +23308,7 @@ const traverse = (root, visitor, options = {}) => {
23278
23308
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
23279
23309
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
23280
23310
  detectCycles: options.detectCycles ?? true,
23281
- skipVisited: options.skipVisited ?? false,
23311
+ skipVisited: normalizeSkipVisited(options.skipVisited),
23282
23312
  mutable: options.mutable ?? false,
23283
23313
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
23284
23314
  };
@@ -23310,7 +23340,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
23310
23340
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
23311
23341
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
23312
23342
  detectCycles: options.detectCycles ?? true,
23313
- skipVisited: options.skipVisited ?? false,
23343
+ skipVisited: normalizeSkipVisited(options.skipVisited),
23314
23344
  mutable: options.mutable ?? false,
23315
23345
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
23316
23346
  };
@@ -23778,7 +23808,9 @@ mergeVisitors[Symbol.for('nodejs.util.promisify.custom')] = mergeVisitorsAsync;
23778
23808
  * @internal
23779
23809
  */
23780
23810
  function createPathProxy(originalPath, currentNode) {
23781
- return new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
23811
+ const proxy = new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
23812
+ proxy.revisited = originalPath.revisited;
23813
+ return proxy;
23782
23814
  }
23783
23815
 
23784
23816
  /***/ }