@speclynx/apidom-ns-json-schema-draft-6 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 +12 -0
- package/dist/apidom-ns-json-schema-draft-6.browser.js +40 -8
- package/dist/apidom-ns-json-schema-draft-6.browser.min.js +1 -1
- package/package.json +9 -9
- package/src/elements/JSONSchema.cjs +3 -1
- package/src/elements/LinkDescription.cjs +3 -1
- package/src/index.cjs +178 -32
- package/src/media-types.cjs +3 -1
- package/src/namespace.cjs +3 -1
- package/src/predicates.cjs +17 -4
- package/src/refractor/index.cjs +3 -1
- package/src/refractor/inspect.cjs +27 -5
- package/src/refractor/plugins/replace-empty-element.cjs +3 -1
- package/src/refractor/specification.cjs +3 -1
- package/src/refractor/toolbox.cjs +3 -1
- package/src/refractor/visitors/json-schema/ExamplesVisitor.cjs +3 -1
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +3 -1
- package/src/refractor/visitors/json-schema/index.cjs +3 -1
- package/src/refractor/visitors/json-schema/link-description/index.cjs +3 -1
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-6
|
|
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-6
|
|
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-6
|
|
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-6
|
|
@@ -21975,6 +21975,14 @@ class Path {
|
|
|
21975
21975
|
*/
|
|
21976
21976
|
inList;
|
|
21977
21977
|
|
|
21978
|
+
/**
|
|
21979
|
+
* True when this node is a non-descending revisit of an already-visited node
|
|
21980
|
+
* (only under skipVisited: 'enter-only'). Children are not traversed.
|
|
21981
|
+
* Set on both the enter and the matching leave phase, so it is meaningful
|
|
21982
|
+
* in either phase.
|
|
21983
|
+
*/
|
|
21984
|
+
revisited = false;
|
|
21985
|
+
|
|
21978
21986
|
/**
|
|
21979
21987
|
* Internal state for traversal control.
|
|
21980
21988
|
*/
|
|
@@ -22559,6 +22567,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22559
22567
|
|
|
22560
22568
|
|
|
22561
22569
|
|
|
22570
|
+
/**
|
|
22571
|
+
* Controls handling of already-visited nodes during traversal.
|
|
22572
|
+
* @public
|
|
22573
|
+
*/
|
|
22562
22574
|
/**
|
|
22563
22575
|
* Options for the traverse function.
|
|
22564
22576
|
* @public
|
|
@@ -22566,6 +22578,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22566
22578
|
// =============================================================================
|
|
22567
22579
|
// Internal types for generator
|
|
22568
22580
|
// =============================================================================
|
|
22581
|
+
|
|
22582
|
+
const normalizeSkipVisited = v => {
|
|
22583
|
+
if (v === true) return 'skip';
|
|
22584
|
+
if (v === false || v === undefined) return 'never';
|
|
22585
|
+
return v;
|
|
22586
|
+
};
|
|
22569
22587
|
// =============================================================================
|
|
22570
22588
|
// Core generator
|
|
22571
22589
|
// =============================================================================
|
|
@@ -22583,7 +22601,7 @@ function* traverseGenerator(root, visitor, options) {
|
|
|
22583
22601
|
mutationFn
|
|
22584
22602
|
} = options;
|
|
22585
22603
|
const keyMapIsFunction = typeof keyMap === 'function';
|
|
22586
|
-
const visitedNodes = skipVisited ? new WeakSet() : null;
|
|
22604
|
+
const visitedNodes = skipVisited !== 'never' ? new WeakSet() : null;
|
|
22587
22605
|
let stack;
|
|
22588
22606
|
let inArray = Array.isArray(root);
|
|
22589
22607
|
let keys = [root];
|
|
@@ -22598,6 +22616,7 @@ function* traverseGenerator(root, visitor, options) {
|
|
|
22598
22616
|
index += 1;
|
|
22599
22617
|
const isLeaving = index === keys.length;
|
|
22600
22618
|
let key;
|
|
22619
|
+
let revisitNoDescend = false;
|
|
22601
22620
|
const isEdited = isLeaving && edits.length !== 0;
|
|
22602
22621
|
if (isLeaving) {
|
|
22603
22622
|
key = ancestors.length === 0 ? undefined : currentPath?.key;
|
|
@@ -22639,6 +22658,7 @@ function* traverseGenerator(root, visitor, options) {
|
|
|
22639
22658
|
edits = stack.edits;
|
|
22640
22659
|
const parentInArray = stack.inArray;
|
|
22641
22660
|
parentPath = stack.parentPath;
|
|
22661
|
+
revisitNoDescend = stack.revisitNoDescend;
|
|
22642
22662
|
stack = stack.prev;
|
|
22643
22663
|
|
|
22644
22664
|
// Push the edited node to parent's edits for propagation up the tree
|
|
@@ -22670,15 +22690,22 @@ function* traverseGenerator(root, visitor, options) {
|
|
|
22670
22690
|
}
|
|
22671
22691
|
|
|
22672
22692
|
// Skip already-visited nodes (handles DAG structures from cloneShallow)
|
|
22673
|
-
if (skipVisited && !isLeaving) {
|
|
22693
|
+
if (skipVisited !== 'never' && !isLeaving) {
|
|
22674
22694
|
if (visitedNodes.has(node)) {
|
|
22675
|
-
|
|
22695
|
+
if (skipVisited === 'enter-only') {
|
|
22696
|
+
// fire enter/leave for this occurrence, but don't re-descend
|
|
22697
|
+
revisitNoDescend = true;
|
|
22698
|
+
} else {
|
|
22699
|
+
continue;
|
|
22700
|
+
}
|
|
22701
|
+
} else {
|
|
22702
|
+
visitedNodes.add(node);
|
|
22676
22703
|
}
|
|
22677
|
-
visitedNodes.add(node);
|
|
22678
22704
|
}
|
|
22679
22705
|
|
|
22680
22706
|
// Always create Path for the current node (needed for parentPath chain)
|
|
22681
22707
|
currentPath = new _Path_mjs__WEBPACK_IMPORTED_MODULE_2__.Path(node, parent, parentPath, key, inArray);
|
|
22708
|
+
currentPath.revisited = revisitNoDescend;
|
|
22682
22709
|
const visitFn = (0,_visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.getVisitFn)(visitor, nodeTypeGetter(node), isLeaving);
|
|
22683
22710
|
if (visitFn) {
|
|
22684
22711
|
// Assign state to visitor
|
|
@@ -22742,10 +22769,13 @@ function* traverseGenerator(root, visitor, options) {
|
|
|
22742
22769
|
keys,
|
|
22743
22770
|
edits,
|
|
22744
22771
|
parentPath,
|
|
22772
|
+
revisitNoDescend,
|
|
22745
22773
|
prev: stack
|
|
22746
22774
|
};
|
|
22747
22775
|
inArray = Array.isArray(node);
|
|
22748
|
-
if (
|
|
22776
|
+
if (revisitNoDescend) {
|
|
22777
|
+
keys = [];
|
|
22778
|
+
} else if (inArray) {
|
|
22749
22779
|
keys = node;
|
|
22750
22780
|
} else if (keyMapIsFunction) {
|
|
22751
22781
|
keys = keyMap(node);
|
|
@@ -22820,7 +22850,7 @@ const traverse = (root, visitor, options = {}) => {
|
|
|
22820
22850
|
nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
|
|
22821
22851
|
nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
|
|
22822
22852
|
detectCycles: options.detectCycles ?? true,
|
|
22823
|
-
skipVisited: options.skipVisited
|
|
22853
|
+
skipVisited: normalizeSkipVisited(options.skipVisited),
|
|
22824
22854
|
mutable: options.mutable ?? false,
|
|
22825
22855
|
mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
|
|
22826
22856
|
};
|
|
@@ -22852,7 +22882,7 @@ const traverseAsync = async (root, visitor, options = {}) => {
|
|
|
22852
22882
|
nodePredicate: options.nodePredicate ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.isNode,
|
|
22853
22883
|
nodeCloneFn: options.nodeCloneFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneNode,
|
|
22854
22884
|
detectCycles: options.detectCycles ?? true,
|
|
22855
|
-
skipVisited: options.skipVisited
|
|
22885
|
+
skipVisited: normalizeSkipVisited(options.skipVisited),
|
|
22856
22886
|
mutable: options.mutable ?? false,
|
|
22857
22887
|
mutationFn: options.mutationFn ?? _visitors_mjs__WEBPACK_IMPORTED_MODULE_3__.mutateNode
|
|
22858
22888
|
};
|
|
@@ -23320,7 +23350,9 @@ mergeVisitors[Symbol.for('nodejs.util.promisify.custom')] = mergeVisitorsAsync;
|
|
|
23320
23350
|
* @internal
|
|
23321
23351
|
*/
|
|
23322
23352
|
function createPathProxy(originalPath, currentNode) {
|
|
23323
|
-
|
|
23353
|
+
const proxy = new _Path_mjs__WEBPACK_IMPORTED_MODULE_4__.Path(currentNode, originalPath.parent, originalPath.parentPath, originalPath.key, originalPath.inList);
|
|
23354
|
+
proxy.revisited = originalPath.revisited;
|
|
23355
|
+
return proxy;
|
|
23324
23356
|
}
|
|
23325
23357
|
|
|
23326
23358
|
/***/ }
|