@speclynx/apidom-ns-json-schema-2020-12 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-2020-12
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-2020-12
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-2020-12
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-2020-12
@@ -23596,6 +23596,14 @@ class Path {
23596
23596
  */
23597
23597
  inList;
23598
23598
 
23599
+ /**
23600
+ * True when this node is a non-descending revisit of an already-visited node
23601
+ * (only under skipVisited: 'enter-only'). Children are not traversed.
23602
+ * Set on both the enter and the matching leave phase, so it is meaningful
23603
+ * in either phase.
23604
+ */
23605
+ revisited = false;
23606
+
23599
23607
  /**
23600
23608
  * Internal state for traversal control.
23601
23609
  */
@@ -24180,6 +24188,10 @@ __webpack_require__.r(__webpack_exports__);
24180
24188
 
24181
24189
 
24182
24190
 
24191
+ /**
24192
+ * Controls handling of already-visited nodes during traversal.
24193
+ * @public
24194
+ */
24183
24195
  /**
24184
24196
  * Options for the traverse function.
24185
24197
  * @public
@@ -24187,6 +24199,12 @@ __webpack_require__.r(__webpack_exports__);
24187
24199
  // =============================================================================
24188
24200
  // Internal types for generator
24189
24201
  // =============================================================================
24202
+
24203
+ const normalizeSkipVisited = v => {
24204
+ if (v === true) return 'skip';
24205
+ if (v === false || v === undefined) return 'never';
24206
+ return v;
24207
+ };
24190
24208
  // =============================================================================
24191
24209
  // Core generator
24192
24210
  // =============================================================================
@@ -24204,7 +24222,7 @@ function* traverseGenerator(root, visitor, options) {
24204
24222
  mutationFn
24205
24223
  } = options;
24206
24224
  const keyMapIsFunction = typeof keyMap === 'function';
24207
- const visitedNodes = skipVisited ? new WeakSet() : null;
24225
+ const visitedNodes = skipVisited !== 'never' ? new WeakSet() : null;
24208
24226
  let stack;
24209
24227
  let inArray = Array.isArray(root);
24210
24228
  let keys = [root];
@@ -24219,6 +24237,7 @@ function* traverseGenerator(root, visitor, options) {
24219
24237
  index += 1;
24220
24238
  const isLeaving = index === keys.length;
24221
24239
  let key;
24240
+ let revisitNoDescend = false;
24222
24241
  const isEdited = isLeaving && edits.length !== 0;
24223
24242
  if (isLeaving) {
24224
24243
  key = ancestors.length === 0 ? undefined : currentPath?.key;
@@ -24260,6 +24279,7 @@ function* traverseGenerator(root, visitor, options) {
24260
24279
  edits = stack.edits;
24261
24280
  const parentInArray = stack.inArray;
24262
24281
  parentPath = stack.parentPath;
24282
+ revisitNoDescend = stack.revisitNoDescend;
24263
24283
  stack = stack.prev;
24264
24284
 
24265
24285
  // Push the edited node to parent's edits for propagation up the tree
@@ -24291,15 +24311,22 @@ function* traverseGenerator(root, visitor, options) {
24291
24311
  }
24292
24312
 
24293
24313
  // Skip already-visited nodes (handles DAG structures from cloneShallow)
24294
- if (skipVisited && !isLeaving) {
24314
+ if (skipVisited !== 'never' && !isLeaving) {
24295
24315
  if (visitedNodes.has(node)) {
24296
- continue;
24316
+ if (skipVisited === 'enter-only') {
24317
+ // fire enter/leave for this occurrence, but don't re-descend
24318
+ revisitNoDescend = true;
24319
+ } else {
24320
+ continue;
24321
+ }
24322
+ } else {
24323
+ visitedNodes.add(node);
24297
24324
  }
24298
- visitedNodes.add(node);
24299
24325
  }
24300
24326
 
24301
24327
  // Always create Path for the current node (needed for parentPath chain)
24302
24328
  currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
24329
+ currentPath.revisited = revisitNoDescend;
24303
24330
  const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
24304
24331
  if (visitFn) {
24305
24332
  // Assign state to visitor
@@ -24363,10 +24390,13 @@ function* traverseGenerator(root, visitor, options) {
24363
24390
  keys,
24364
24391
  edits,
24365
24392
  parentPath,
24393
+ revisitNoDescend,
24366
24394
  prev: stack
24367
24395
  };
24368
24396
  inArray = Array.isArray(node);
24369
- if (inArray) {
24397
+ if (revisitNoDescend) {
24398
+ keys = [];
24399
+ } else if (inArray) {
24370
24400
  keys = node;
24371
24401
  } else if (keyMapIsFunction) {
24372
24402
  keys = keyMap(node);
@@ -24441,7 +24471,7 @@ const traverse = (root, visitor, options = {}) => {
24441
24471
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
24442
24472
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
24443
24473
  detectCycles: options.detectCycles ?? true,
24444
- skipVisited: options.skipVisited ?? false,
24474
+ skipVisited: normalizeSkipVisited(options.skipVisited),
24445
24475
  mutable: options.mutable ?? false,
24446
24476
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
24447
24477
  };
@@ -24473,7 +24503,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
24473
24503
  nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
24474
24504
  nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
24475
24505
  detectCycles: options.detectCycles ?? true,
24476
- skipVisited: options.skipVisited ?? false,
24506
+ skipVisited: normalizeSkipVisited(options.skipVisited),
24477
24507
  mutable: options.mutable ?? false,
24478
24508
  mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
24479
24509
  };
@@ -24941,7 +24971,9 @@ mergeVisitors[Symbol.for('nodejs.util.promisify.custom')] = mergeVisitorsAsync;
24941
24971
  * @internal
24942
24972
  */
24943
24973
  function createPathProxy(originalPath, currentNode) {
24944
- return new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
24974
+ const proxy = new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
24975
+ proxy.revisited = originalPath.revisited;
24976
+ return proxy;
24945
24977
  }
24946
24978
 
24947
24979
  /***/ }