@speclynx/apidom-ns-openapi-3-0 5.0.2 → 5.1.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 +15 -0
- package/dist/apidom-ns-openapi-3-0.browser.js +157 -47
- package/dist/apidom-ns-openapi-3-0.browser.min.js +1 -1
- package/package.json +10 -10
- package/src/refractor/plugins/normalize-parameters.cjs +16 -1
- package/src/refractor/plugins/normalize-parameters.mjs +17 -2
- package/src/refractor/plugins/replace-empty-element.cjs +1 -1
- package/src/refractor/plugins/replace-empty-element.mjs +1 -1
- package/src/refractor/visitors/Visitor.cjs +1 -1
- package/src/refractor/visitors/Visitor.mjs +1 -1
- package/src/refractor/visitors/open-api-3-0/operation/TagsVisitor.cjs +1 -0
- package/src/refractor/visitors/open-api-3-0/operation/TagsVisitor.mjs +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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
|
+
## [5.1.1](https://github.com/speclynx/apidom/compare/v5.1.0...v5.1.1) (2026-08-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-0
|
|
9
|
+
|
|
10
|
+
# [5.1.0](https://github.com/speclynx/apidom/compare/v5.0.2...v5.1.0) (2026-08-09)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **ns-openapi-3-0:** correct sideEffects path to refractor/inspect ([bc096e3](https://github.com/speclynx/apidom/commit/bc096e3cbfdd9a7ca16d9bc730fa9ee26dd0accd))
|
|
15
|
+
- **ns:** transfer style in refractor visitors using the concat pattern ([#442](https://github.com/speclynx/apidom/issues/442)) ([dc483cc](https://github.com/speclynx/apidom/commit/dc483ccebb80877d96e1c62b34781a96dd96b403))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **datamodel:** support Metadata in cloneDeep and cloneShallow ([#443](https://github.com/speclynx/apidom/issues/443)) ([8e7e27a](https://github.com/speclynx/apidom/commit/8e7e27a7b01223bba13e54c9703a0c1da34a47d6)), closes [cloneDeep/#cloneShallow](https://github.com/speclynx/apidom/issues/cloneShallow)
|
|
20
|
+
|
|
6
21
|
## [5.0.2](https://github.com/speclynx/apidom/compare/v5.0.1...v5.0.2) (2026-08-04)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-0
|
|
@@ -3405,9 +3405,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3405
3405
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1942);
|
|
3406
3406
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4673);
|
|
3407
3407
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5162);
|
|
3408
|
-
/* harmony import */ var
|
|
3409
|
-
/* harmony import */ var
|
|
3410
|
-
/* harmony import */ var
|
|
3408
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2111);
|
|
3409
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5810);
|
|
3410
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9686);
|
|
3411
|
+
/* harmony import */ var _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8748);
|
|
3412
|
+
/* harmony import */ var _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3313);
|
|
3413
|
+
/* harmony import */ var _predicates_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7269);
|
|
3411
3414
|
|
|
3412
3415
|
|
|
3413
3416
|
|
|
@@ -3435,8 +3438,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3435
3438
|
* {@link https://spec.openapis.org/oas/v3.0.4.html#operation-object}
|
|
3436
3439
|
*/
|
|
3437
3440
|
const parameterEquals = (parameter1, parameter2) => {
|
|
3438
|
-
if (!(0,
|
|
3439
|
-
if (!(0,
|
|
3441
|
+
if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_8__.isParameterElement)(parameter1)) return false;
|
|
3442
|
+
if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_8__.isParameterElement)(parameter2)) return false;
|
|
3440
3443
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter1.name)) return false;
|
|
3441
3444
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter1.in)) return false;
|
|
3442
3445
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter2.name)) return false;
|
|
@@ -3457,7 +3460,22 @@ const inheritParametersToOperation = (operationElement, pathItemElement) => {
|
|
|
3457
3460
|
|
|
3458
3461
|
// prefers the first item if two items compare equal based on the predicate
|
|
3459
3462
|
const mergedParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(parameterEquals, [...operationParams, ...pathItemParams]);
|
|
3460
|
-
operationElement.parameters
|
|
3463
|
+
const originalParameters = operationElement.parameters;
|
|
3464
|
+
const mergedElement = new _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_6__["default"](mergedParameters);
|
|
3465
|
+
|
|
3466
|
+
// the merged container may replace an existing source container — carry over
|
|
3467
|
+
// its meta, attributes, source map and style
|
|
3468
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isArrayElement)(originalParameters)) {
|
|
3469
|
+
if (!originalParameters.isMetaEmpty) {
|
|
3470
|
+
mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(originalParameters.meta);
|
|
3471
|
+
}
|
|
3472
|
+
if (!originalParameters.isAttributesEmpty) {
|
|
3473
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(originalParameters.attributes);
|
|
3474
|
+
}
|
|
3475
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"].transfer(originalParameters, mergedElement);
|
|
3476
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(originalParameters, mergedElement);
|
|
3477
|
+
}
|
|
3478
|
+
operationElement.parameters = mergedElement;
|
|
3461
3479
|
};
|
|
3462
3480
|
|
|
3463
3481
|
/**
|
|
@@ -3475,7 +3493,7 @@ const plugin = ({
|
|
|
3475
3493
|
OpenApi3_0Element: {
|
|
3476
3494
|
enter(path) {
|
|
3477
3495
|
const element = path.node;
|
|
3478
|
-
storage = new
|
|
3496
|
+
storage = new _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_7__["default"](element, storageField, 'parameters');
|
|
3479
3497
|
},
|
|
3480
3498
|
leave() {
|
|
3481
3499
|
storage = undefined;
|
|
@@ -4522,7 +4540,7 @@ const plugin = () => () => ({
|
|
|
4522
4540
|
if (typeof elementFactory !== 'function') return;
|
|
4523
4541
|
const newElement = elementFactory.call({
|
|
4524
4542
|
context
|
|
4525
|
-
}, undefined, element.isMetaEmpty ? undefined : element.meta
|
|
4543
|
+
}, undefined, element.isMetaEmpty ? undefined : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.meta), element.isAttributesEmpty ? undefined : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes));
|
|
4526
4544
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, newElement);
|
|
4527
4545
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"].transfer(element, newElement);
|
|
4528
4546
|
path.replaceWith(newElement);
|
|
@@ -5571,7 +5589,7 @@ class SpecificationVisitor extends _Visitor_ts__WEBPACK_IMPORTED_MODULE_6__["def
|
|
|
5571
5589
|
if (visitor instanceof _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
5572
5590
|
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
5573
5591
|
}
|
|
5574
|
-
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, {
|
|
5592
|
+
;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, {
|
|
5575
5593
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.getNodePrimitiveType
|
|
5576
5594
|
});
|
|
5577
5595
|
return visitor.element;
|
|
@@ -5614,7 +5632,7 @@ class Visitor {
|
|
|
5614
5632
|
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
5615
5633
|
to.meta = to.meta.merge(from.meta);
|
|
5616
5634
|
} else if (!from.isMetaEmpty) {
|
|
5617
|
-
to.meta = from.meta
|
|
5635
|
+
to.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.meta);
|
|
5618
5636
|
}
|
|
5619
5637
|
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
5620
5638
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
@@ -7930,6 +7948,7 @@ class TagsVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["defa
|
|
|
7930
7948
|
ArrayElement(path) {
|
|
7931
7949
|
const arrayElement = path.node;
|
|
7932
7950
|
this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
|
|
7951
|
+
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
7933
7952
|
path.stop();
|
|
7934
7953
|
}
|
|
7935
7954
|
}
|
|
@@ -10030,7 +10049,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
10030
10049
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
10031
10050
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10032
10051
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
10033
|
-
|
|
10052
|
+
;
|
|
10034
10053
|
|
|
10035
10054
|
var _CompositeEvaluationRealm_brand = /*#__PURE__*/new WeakSet();
|
|
10036
10055
|
class CompositeEvaluationRealm extends _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
@@ -18867,7 +18886,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
18867
18886
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
18868
18887
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18869
18888
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18870
|
-
|
|
18889
|
+
;
|
|
18871
18890
|
|
|
18872
18891
|
/**
|
|
18873
18892
|
* Can be used as a way to compose multiple invokers together to form polymorphic functions,
|
|
@@ -25139,7 +25158,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25139
25158
|
* @public
|
|
25140
25159
|
*/
|
|
25141
25160
|
const emptyElement = element => {
|
|
25142
|
-
const meta = !element.isMetaEmpty ? element.meta
|
|
25161
|
+
const meta = !element.isMetaEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.meta) : undefined;
|
|
25143
25162
|
const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
|
|
25144
25163
|
|
|
25145
25164
|
// @ts-ignore
|
|
@@ -25155,7 +25174,7 @@ const getMergeFunction = (keyElement, options) => {
|
|
|
25155
25174
|
};
|
|
25156
25175
|
const getMetaMergeFunction = options => {
|
|
25157
25176
|
if (typeof options.customMetaMerge !== 'function') {
|
|
25158
|
-
return targetMeta =>
|
|
25177
|
+
return targetMeta => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetMeta);
|
|
25159
25178
|
}
|
|
25160
25179
|
return options.customMetaMerge;
|
|
25161
25180
|
};
|
|
@@ -25230,9 +25249,9 @@ const deepmerge = (targetElement, sourceElement, options) => {
|
|
|
25230
25249
|
if (!targetElement.isMetaEmpty && !sourceElement.isMetaEmpty) {
|
|
25231
25250
|
mergedElement.meta = getMetaMergeFunction(mergedOptions)(targetElement.meta, sourceElement.meta);
|
|
25232
25251
|
} else if (!targetElement.isMetaEmpty) {
|
|
25233
|
-
mergedElement.meta = targetElement.meta
|
|
25252
|
+
mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetElement.meta);
|
|
25234
25253
|
} else if (!sourceElement.isMetaEmpty) {
|
|
25235
|
-
mergedElement.meta = sourceElement.meta
|
|
25254
|
+
mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(sourceElement.meta);
|
|
25236
25255
|
}
|
|
25237
25256
|
if (!targetElement.isAttributesEmpty && !sourceElement.isAttributesEmpty) {
|
|
25238
25257
|
mergedElement.attributes = getAttributesMergeFunction(mergedOptions)(targetElement.attributes, sourceElement.attributes);
|
|
@@ -25495,6 +25514,7 @@ const resolveSpecification = specification => {
|
|
|
25495
25514
|
__webpack_require__.r(__webpack_exports__);
|
|
25496
25515
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5162);
|
|
25497
25516
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6911);
|
|
25517
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(977);
|
|
25498
25518
|
|
|
25499
25519
|
|
|
25500
25520
|
/**
|
|
@@ -25522,7 +25542,7 @@ const serializer = element => {
|
|
|
25522
25542
|
node.forEach((value, key) => {
|
|
25523
25543
|
const k = serialize(key);
|
|
25524
25544
|
const v = serialize(value);
|
|
25525
|
-
if (typeof k === 'string')
|
|
25545
|
+
if (typeof k === 'string') (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, k, v);
|
|
25526
25546
|
});
|
|
25527
25547
|
return obj;
|
|
25528
25548
|
}
|
|
@@ -25547,6 +25567,38 @@ const serializer = element => {
|
|
|
25547
25567
|
/* harmony export */ ]);
|
|
25548
25568
|
|
|
25549
25569
|
|
|
25570
|
+
/***/ },
|
|
25571
|
+
|
|
25572
|
+
/***/ 977
|
|
25573
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25574
|
+
|
|
25575
|
+
__webpack_require__.r(__webpack_exports__);
|
|
25576
|
+
/**
|
|
25577
|
+
* Defines a key on a plain object being built from an ApiDOM element tree.
|
|
25578
|
+
*
|
|
25579
|
+
* A "__proto__" key must be defined rather than assigned: assignment invokes
|
|
25580
|
+
* the prototype setter, which drops the member from the result and hands
|
|
25581
|
+
* document content to consumers as the object's prototype. Every other key
|
|
25582
|
+
* takes the plain assignment fast path.
|
|
25583
|
+
*/
|
|
25584
|
+
const setProperty = (target, key, value) => {
|
|
25585
|
+
if (key === '__proto__') {
|
|
25586
|
+
Object.defineProperty(target, key, {
|
|
25587
|
+
value,
|
|
25588
|
+
enumerable: true,
|
|
25589
|
+
writable: true,
|
|
25590
|
+
configurable: true
|
|
25591
|
+
});
|
|
25592
|
+
} else {
|
|
25593
|
+
target[key] = value;
|
|
25594
|
+
}
|
|
25595
|
+
};
|
|
25596
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setProperty);
|
|
25597
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
25598
|
+
/* harmony export */ "default", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
|
|
25599
|
+
/* harmony export */ ]);
|
|
25600
|
+
|
|
25601
|
+
|
|
25550
25602
|
/***/ },
|
|
25551
25603
|
|
|
25552
25604
|
/***/ 6663
|
|
@@ -25592,6 +25644,8 @@ class KeyValuePair {
|
|
|
25592
25644
|
|
|
25593
25645
|
__webpack_require__.r(__webpack_exports__);
|
|
25594
25646
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
25647
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4883);
|
|
25648
|
+
|
|
25595
25649
|
|
|
25596
25650
|
/**
|
|
25597
25651
|
* Lightweight meta container for Element metadata.
|
|
@@ -25608,7 +25662,7 @@ class Metadata {
|
|
|
25608
25662
|
return this[name];
|
|
25609
25663
|
}
|
|
25610
25664
|
set(name, value) {
|
|
25611
|
-
|
|
25665
|
+
;(0,_util_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(this, name, value);
|
|
25612
25666
|
}
|
|
25613
25667
|
hasKey(name) {
|
|
25614
25668
|
return Object.hasOwn(this, name);
|
|
@@ -25641,7 +25695,19 @@ class Metadata {
|
|
|
25641
25695
|
*/
|
|
25642
25696
|
cloneShallow() {
|
|
25643
25697
|
const clone = new Metadata();
|
|
25644
|
-
|
|
25698
|
+
|
|
25699
|
+
// Object.assign is the fast path but invokes the prototype setter for a
|
|
25700
|
+
// "__proto__" key, hijacking the clone's prototype. That key can only come
|
|
25701
|
+
// from untrusted input, so check for it once and fall back to a guarded
|
|
25702
|
+
// copy. Copying property descriptors instead would carry writable:false
|
|
25703
|
+
// over from a frozen source and hand back an unmodifiable clone.
|
|
25704
|
+
if (!Object.hasOwn(this, '__proto__')) {
|
|
25705
|
+
Object.assign(clone, this);
|
|
25706
|
+
} else {
|
|
25707
|
+
for (const key of Object.keys(this)) {
|
|
25708
|
+
(0,_util_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(clone, key, this[key]);
|
|
25709
|
+
}
|
|
25710
|
+
}
|
|
25645
25711
|
return clone;
|
|
25646
25712
|
}
|
|
25647
25713
|
|
|
@@ -26197,19 +26263,21 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
|
|
|
26197
26263
|
|
|
26198
26264
|
__webpack_require__.r(__webpack_exports__);
|
|
26199
26265
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26200
|
-
/* harmony export */ CloneError: () => (/* reexport safe */
|
|
26201
|
-
/* harmony export */ DeepCloneError: () => (/* reexport safe */
|
|
26202
|
-
/* harmony export */ ShallowCloneError: () => (/* reexport safe */
|
|
26266
|
+
/* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
|
|
26267
|
+
/* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
26268
|
+
/* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"])
|
|
26203
26269
|
/* harmony export */ });
|
|
26204
26270
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
26205
26271
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8504);
|
|
26206
26272
|
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6663);
|
|
26207
|
-
/* harmony import */ var
|
|
26208
|
-
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
26209
|
-
/* harmony import */ var
|
|
26210
|
-
/* harmony import */ var
|
|
26211
|
-
/* harmony import */ var
|
|
26212
|
-
/* harmony import */ var
|
|
26273
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1844);
|
|
26274
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8252);
|
|
26275
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5162);
|
|
26276
|
+
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5810);
|
|
26277
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5018);
|
|
26278
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3686);
|
|
26279
|
+
/* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3772);
|
|
26280
|
+
|
|
26213
26281
|
|
|
26214
26282
|
|
|
26215
26283
|
|
|
@@ -26243,7 +26311,7 @@ const cloneDeepElement = (element, options) => {
|
|
|
26243
26311
|
} = element;
|
|
26244
26312
|
if (Array.isArray(content)) {
|
|
26245
26313
|
copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
|
|
26246
|
-
} else if ((0,
|
|
26314
|
+
} else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
|
|
26247
26315
|
copy.content = cloneDeepElement(content, passThroughOptions);
|
|
26248
26316
|
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
26249
26317
|
copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
|
|
@@ -26291,7 +26359,7 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
26291
26359
|
};
|
|
26292
26360
|
|
|
26293
26361
|
/**
|
|
26294
|
-
* Creates a deep clone of an ApiDOM Element, KeyValuePair, or
|
|
26362
|
+
* Creates a deep clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
|
|
26295
26363
|
* Handles cycles by memoizing visited objects.
|
|
26296
26364
|
* @public
|
|
26297
26365
|
*/
|
|
@@ -26302,10 +26370,13 @@ const cloneDeep = (value, options = {}) => {
|
|
|
26302
26370
|
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
26303
26371
|
return cloneDeepObjectSlice(value, options);
|
|
26304
26372
|
}
|
|
26305
|
-
if (
|
|
26373
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
26374
|
+
return value.cloneDeep();
|
|
26375
|
+
}
|
|
26376
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
|
|
26306
26377
|
return cloneDeepElement(value, options);
|
|
26307
26378
|
}
|
|
26308
|
-
throw new
|
|
26379
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
26309
26380
|
value
|
|
26310
26381
|
});
|
|
26311
26382
|
};
|
|
@@ -26332,21 +26403,21 @@ const cloneShallowElement = element => {
|
|
|
26332
26403
|
const copy = new Ctor();
|
|
26333
26404
|
copy.element = element.element;
|
|
26334
26405
|
if (!element.isMetaEmpty) {
|
|
26335
|
-
copy.meta = element.meta
|
|
26406
|
+
copy.meta = cloneDeep(element.meta);
|
|
26336
26407
|
}
|
|
26337
26408
|
if (!element.isAttributesEmpty) {
|
|
26338
26409
|
copy.attributes = cloneDeep(element.attributes);
|
|
26339
26410
|
}
|
|
26340
|
-
if ((0,
|
|
26341
|
-
|
|
26411
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementSourceMap)(element)) {
|
|
26412
|
+
_elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].transfer(element, copy);
|
|
26342
26413
|
}
|
|
26343
|
-
if ((0,
|
|
26414
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementStyle)(element)) {
|
|
26344
26415
|
copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
|
|
26345
26416
|
}
|
|
26346
26417
|
const {
|
|
26347
26418
|
content
|
|
26348
26419
|
} = element;
|
|
26349
|
-
if ((0,
|
|
26420
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
|
|
26350
26421
|
copy.content = cloneShallowElement(content);
|
|
26351
26422
|
} else if (Array.isArray(content)) {
|
|
26352
26423
|
copy.content = [...content];
|
|
@@ -26359,7 +26430,7 @@ const cloneShallowElement = element => {
|
|
|
26359
26430
|
};
|
|
26360
26431
|
|
|
26361
26432
|
/**
|
|
26362
|
-
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or
|
|
26433
|
+
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
|
|
26363
26434
|
* The element itself is cloned, but content references are shared.
|
|
26364
26435
|
* Meta and attributes are deep cloned to preserve semantic information.
|
|
26365
26436
|
* @public
|
|
@@ -26371,10 +26442,13 @@ const cloneShallow = value => {
|
|
|
26371
26442
|
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
26372
26443
|
return cloneShallowObjectSlice(value);
|
|
26373
26444
|
}
|
|
26374
|
-
if (
|
|
26445
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
26446
|
+
return value.cloneShallow();
|
|
26447
|
+
}
|
|
26448
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
|
|
26375
26449
|
return cloneShallowElement(value);
|
|
26376
26450
|
}
|
|
26377
|
-
throw new
|
|
26451
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
26378
26452
|
value
|
|
26379
26453
|
});
|
|
26380
26454
|
};
|
|
@@ -28118,6 +28192,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
28118
28192
|
/* harmony import */ var _CollectionElement_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4536);
|
|
28119
28193
|
/* harmony import */ var _MemberElement_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1770);
|
|
28120
28194
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8504);
|
|
28195
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4883);
|
|
28196
|
+
|
|
28121
28197
|
|
|
28122
28198
|
|
|
28123
28199
|
|
|
@@ -28142,7 +28218,7 @@ class ObjectElement extends _CollectionElement_mjs__WEBPACK_IMPORTED_MODULE_0__[
|
|
|
28142
28218
|
}
|
|
28143
28219
|
toValue() {
|
|
28144
28220
|
return this._content.reduce((results, el) => {
|
|
28145
|
-
results
|
|
28221
|
+
;(0,_util_mjs__WEBPACK_IMPORTED_MODULE_3__["default"])(results, el.key.toValue(), el.value ? el.value.toValue() : undefined);
|
|
28146
28222
|
return results;
|
|
28147
28223
|
}, {});
|
|
28148
28224
|
}
|
|
@@ -28506,6 +28582,8 @@ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.cloneDeepElemen
|
|
|
28506
28582
|
__webpack_require__.r(__webpack_exports__);
|
|
28507
28583
|
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5810);
|
|
28508
28584
|
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9686);
|
|
28585
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4883);
|
|
28586
|
+
|
|
28509
28587
|
|
|
28510
28588
|
|
|
28511
28589
|
/**
|
|
@@ -28693,12 +28771,12 @@ class JSONSerialiser {
|
|
|
28693
28771
|
let hasEntries = false;
|
|
28694
28772
|
for (const [key, value] of Object.entries(element.meta)) {
|
|
28695
28773
|
if (value instanceof this.namespace.elements.Element) {
|
|
28696
|
-
|
|
28774
|
+
(0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(meta, key, this.serialise(value));
|
|
28697
28775
|
hasEntries = true;
|
|
28698
28776
|
} else if (value !== undefined) {
|
|
28699
28777
|
// refract primitives to maintain JSON Refract spec compatibility
|
|
28700
28778
|
const refracted = element.refract(value);
|
|
28701
|
-
|
|
28779
|
+
(0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(meta, key, this.serialise(refracted));
|
|
28702
28780
|
rawKeys.push(key);
|
|
28703
28781
|
hasEntries = true;
|
|
28704
28782
|
}
|
|
@@ -28712,7 +28790,7 @@ class JSONSerialiser {
|
|
|
28712
28790
|
const result = {};
|
|
28713
28791
|
obj.forEach((value, key) => {
|
|
28714
28792
|
if (value) {
|
|
28715
|
-
result
|
|
28793
|
+
(0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(result, key.toValue(), this.serialise(value));
|
|
28716
28794
|
}
|
|
28717
28795
|
});
|
|
28718
28796
|
if (Object.keys(result).length === 0) {
|
|
@@ -28732,6 +28810,38 @@ class JSONSerialiser {
|
|
|
28732
28810
|
/* harmony export */ ]);
|
|
28733
28811
|
|
|
28734
28812
|
|
|
28813
|
+
/***/ },
|
|
28814
|
+
|
|
28815
|
+
/***/ 4883
|
|
28816
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
28817
|
+
|
|
28818
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28819
|
+
/**
|
|
28820
|
+
* Defines a key on a plain object or class instance built from untrusted input.
|
|
28821
|
+
*
|
|
28822
|
+
* A "__proto__" key must be defined rather than assigned: assignment invokes the
|
|
28823
|
+
* prototype setter, which drops the member from the result and replaces the
|
|
28824
|
+
* target's prototype with the incoming value. Every other key takes the plain
|
|
28825
|
+
* assignment fast path.
|
|
28826
|
+
*/
|
|
28827
|
+
const setProperty = (target, key, value) => {
|
|
28828
|
+
if (key === '__proto__') {
|
|
28829
|
+
Object.defineProperty(target, key, {
|
|
28830
|
+
value,
|
|
28831
|
+
enumerable: true,
|
|
28832
|
+
writable: true,
|
|
28833
|
+
configurable: true
|
|
28834
|
+
});
|
|
28835
|
+
} else {
|
|
28836
|
+
target[key] = value;
|
|
28837
|
+
}
|
|
28838
|
+
};
|
|
28839
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setProperty);
|
|
28840
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
28841
|
+
/* harmony export */ "default", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
|
|
28842
|
+
/* harmony export */ ]);
|
|
28843
|
+
|
|
28844
|
+
|
|
28735
28845
|
/***/ },
|
|
28736
28846
|
|
|
28737
28847
|
/***/ 3437
|
|
@@ -29763,7 +29873,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
29763
29873
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
29764
29874
|
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
29765
29875
|
}
|
|
29766
|
-
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
29876
|
+
;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
29767
29877
|
return visitor.element;
|
|
29768
29878
|
}
|
|
29769
29879
|
}
|
|
@@ -29804,7 +29914,7 @@ class Visitor {
|
|
|
29804
29914
|
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
29805
29915
|
to.meta = to.meta.merge(from.meta);
|
|
29806
29916
|
} else if (!from.isMetaEmpty) {
|
|
29807
|
-
to.meta = from.meta
|
|
29917
|
+
to.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.meta);
|
|
29808
29918
|
}
|
|
29809
29919
|
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
29810
29920
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
@@ -31332,7 +31442,7 @@ const forEach = (element, options) => {
|
|
|
31332
31442
|
callback = options.callback ?? (() => {});
|
|
31333
31443
|
predicate = options.predicate ?? (() => true);
|
|
31334
31444
|
}
|
|
31335
|
-
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
31445
|
+
;(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
31336
31446
|
enter(path) {
|
|
31337
31447
|
if (predicate(path)) {
|
|
31338
31448
|
callback(path);
|