@speclynx/apidom-ns-openapi-3-0 5.0.1 → 5.1.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 +15 -0
- package/dist/apidom-ns-openapi-3-0.browser.js +67 -40
- 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.0](https://github.com/speclynx/apidom/compare/v5.0.2...v5.1.0) (2026-08-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ns-openapi-3-0:** correct sideEffects path to refractor/inspect ([bc096e3](https://github.com/speclynx/apidom/commit/bc096e3cbfdd9a7ca16d9bc730fa9ee26dd0accd))
|
|
11
|
+
- **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))
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **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)
|
|
16
|
+
|
|
17
|
+
## [5.0.2](https://github.com/speclynx/apidom/compare/v5.0.1...v5.0.2) (2026-08-04)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-0
|
|
20
|
+
|
|
6
21
|
## [5.0.1](https://github.com/speclynx/apidom/compare/v5.0.0...v5.0.1) (2026-07-07)
|
|
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);
|
|
@@ -26197,19 +26216,21 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
|
|
|
26197
26216
|
|
|
26198
26217
|
__webpack_require__.r(__webpack_exports__);
|
|
26199
26218
|
/* 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 */
|
|
26219
|
+
/* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
|
|
26220
|
+
/* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
26221
|
+
/* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"])
|
|
26203
26222
|
/* harmony export */ });
|
|
26204
26223
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
26205
26224
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8504);
|
|
26206
26225
|
/* 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
|
|
26226
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1844);
|
|
26227
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8252);
|
|
26228
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5162);
|
|
26229
|
+
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5810);
|
|
26230
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5018);
|
|
26231
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3686);
|
|
26232
|
+
/* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3772);
|
|
26233
|
+
|
|
26213
26234
|
|
|
26214
26235
|
|
|
26215
26236
|
|
|
@@ -26243,7 +26264,7 @@ const cloneDeepElement = (element, options) => {
|
|
|
26243
26264
|
} = element;
|
|
26244
26265
|
if (Array.isArray(content)) {
|
|
26245
26266
|
copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
|
|
26246
|
-
} else if ((0,
|
|
26267
|
+
} else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
|
|
26247
26268
|
copy.content = cloneDeepElement(content, passThroughOptions);
|
|
26248
26269
|
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
26249
26270
|
copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
|
|
@@ -26291,7 +26312,7 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
26291
26312
|
};
|
|
26292
26313
|
|
|
26293
26314
|
/**
|
|
26294
|
-
* Creates a deep clone of an ApiDOM Element, KeyValuePair, or
|
|
26315
|
+
* Creates a deep clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
|
|
26295
26316
|
* Handles cycles by memoizing visited objects.
|
|
26296
26317
|
* @public
|
|
26297
26318
|
*/
|
|
@@ -26302,10 +26323,13 @@ const cloneDeep = (value, options = {}) => {
|
|
|
26302
26323
|
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
26303
26324
|
return cloneDeepObjectSlice(value, options);
|
|
26304
26325
|
}
|
|
26305
|
-
if (
|
|
26326
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
26327
|
+
return value.cloneDeep();
|
|
26328
|
+
}
|
|
26329
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
|
|
26306
26330
|
return cloneDeepElement(value, options);
|
|
26307
26331
|
}
|
|
26308
|
-
throw new
|
|
26332
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
26309
26333
|
value
|
|
26310
26334
|
});
|
|
26311
26335
|
};
|
|
@@ -26332,21 +26356,21 @@ const cloneShallowElement = element => {
|
|
|
26332
26356
|
const copy = new Ctor();
|
|
26333
26357
|
copy.element = element.element;
|
|
26334
26358
|
if (!element.isMetaEmpty) {
|
|
26335
|
-
copy.meta = element.meta
|
|
26359
|
+
copy.meta = cloneDeep(element.meta);
|
|
26336
26360
|
}
|
|
26337
26361
|
if (!element.isAttributesEmpty) {
|
|
26338
26362
|
copy.attributes = cloneDeep(element.attributes);
|
|
26339
26363
|
}
|
|
26340
|
-
if ((0,
|
|
26341
|
-
|
|
26364
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementSourceMap)(element)) {
|
|
26365
|
+
_elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].transfer(element, copy);
|
|
26342
26366
|
}
|
|
26343
|
-
if ((0,
|
|
26367
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementStyle)(element)) {
|
|
26344
26368
|
copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
|
|
26345
26369
|
}
|
|
26346
26370
|
const {
|
|
26347
26371
|
content
|
|
26348
26372
|
} = element;
|
|
26349
|
-
if ((0,
|
|
26373
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
|
|
26350
26374
|
copy.content = cloneShallowElement(content);
|
|
26351
26375
|
} else if (Array.isArray(content)) {
|
|
26352
26376
|
copy.content = [...content];
|
|
@@ -26359,7 +26383,7 @@ const cloneShallowElement = element => {
|
|
|
26359
26383
|
};
|
|
26360
26384
|
|
|
26361
26385
|
/**
|
|
26362
|
-
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or
|
|
26386
|
+
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
|
|
26363
26387
|
* The element itself is cloned, but content references are shared.
|
|
26364
26388
|
* Meta and attributes are deep cloned to preserve semantic information.
|
|
26365
26389
|
* @public
|
|
@@ -26371,10 +26395,13 @@ const cloneShallow = value => {
|
|
|
26371
26395
|
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
26372
26396
|
return cloneShallowObjectSlice(value);
|
|
26373
26397
|
}
|
|
26374
|
-
if (
|
|
26398
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
26399
|
+
return value.cloneShallow();
|
|
26400
|
+
}
|
|
26401
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
|
|
26375
26402
|
return cloneShallowElement(value);
|
|
26376
26403
|
}
|
|
26377
|
-
throw new
|
|
26404
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
26378
26405
|
value
|
|
26379
26406
|
});
|
|
26380
26407
|
};
|
|
@@ -29763,7 +29790,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
29763
29790
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
29764
29791
|
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
29765
29792
|
}
|
|
29766
|
-
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
29793
|
+
;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
29767
29794
|
return visitor.element;
|
|
29768
29795
|
}
|
|
29769
29796
|
}
|
|
@@ -29804,7 +29831,7 @@ class Visitor {
|
|
|
29804
29831
|
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
29805
29832
|
to.meta = to.meta.merge(from.meta);
|
|
29806
29833
|
} else if (!from.isMetaEmpty) {
|
|
29807
|
-
to.meta = from.meta
|
|
29834
|
+
to.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.meta);
|
|
29808
29835
|
}
|
|
29809
29836
|
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
29810
29837
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
@@ -31332,7 +31359,7 @@ const forEach = (element, options) => {
|
|
|
31332
31359
|
callback = options.callback ?? (() => {});
|
|
31333
31360
|
predicate = options.predicate ?? (() => true);
|
|
31334
31361
|
}
|
|
31335
|
-
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
31362
|
+
;(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
31336
31363
|
enter(path) {
|
|
31337
31364
|
if (predicate(path)) {
|
|
31338
31365
|
callback(path);
|