@swagger-api/apidom-parser-adapter-yaml-1-2 0.76.2 → 0.77.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 +4 -0
- package/cjs/adapter.cjs +1 -2
- package/cjs/lexical-analysis/browser.cjs +1 -2
- package/cjs/lexical-analysis/node.cjs +1 -2
- package/cjs/media-types.cjs +1 -2
- package/cjs/syntactic-analysis/TreeCursorIterator.cjs +1 -2
- package/cjs/syntactic-analysis/TreeCursorSyntaxNode.cjs +1 -2
- package/cjs/syntactic-analysis/indirect/index.cjs +1 -2
- package/cjs/syntactic-analysis/indirect/visitors/CstVisitor.cjs +2 -4
- package/cjs/syntactic-analysis/indirect/visitors/YamlAstVisitor.cjs +2 -4
- package/dist/apidom-parser-adapter-yaml-1-2.browser.js +264 -88
- package/dist/apidom-parser-adapter-yaml1-2.browser.min.js +1 -1
- package/package.json +5 -5
|
@@ -29500,6 +29500,7 @@ const isParseResult = isNodeType.bind(undefined, 'parseResult');
|
|
|
29500
29500
|
__webpack_require__.r(__webpack_exports__);
|
|
29501
29501
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29502
29502
|
/* harmony export */ BREAK: () => (/* binding */ BREAK),
|
|
29503
|
+
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
29503
29504
|
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
29504
29505
|
/* harmony export */ getVisitFn: () => (/* binding */ getVisitFn),
|
|
29505
29506
|
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
@@ -29552,6 +29553,9 @@ const getNodeType = node => node === null || node === void 0 ? void 0 : node.typ
|
|
|
29552
29553
|
// isNode :: Node -> Boolean
|
|
29553
29554
|
const isNode = node => typeof getNodeType(node) === 'string';
|
|
29554
29555
|
|
|
29556
|
+
// cloneNode :: a -> a
|
|
29557
|
+
const cloneNode = node => Object.create(Object.getPrototypeOf(node), Object.getOwnPropertyDescriptors(node));
|
|
29558
|
+
|
|
29555
29559
|
/**
|
|
29556
29560
|
* Creates a new visitor instance which delegates to many visitors to run in
|
|
29557
29561
|
* parallel. Each visitor will be visited for each node before moving on.
|
|
@@ -29562,11 +29566,11 @@ const mergeAll = (visitors, {
|
|
|
29562
29566
|
visitFnGetter = getVisitFn,
|
|
29563
29567
|
nodeTypeGetter = getNodeType
|
|
29564
29568
|
} = {}) => {
|
|
29565
|
-
const skipping = new Array(visitors.length);
|
|
29569
|
+
const skipping = new Array(visitors.length).fill(null);
|
|
29566
29570
|
return {
|
|
29567
29571
|
enter(node, ...rest) {
|
|
29568
29572
|
for (let i = 0; i < visitors.length; i += 1) {
|
|
29569
|
-
if (skipping[i]
|
|
29573
|
+
if (skipping[i] === null) {
|
|
29570
29574
|
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */false);
|
|
29571
29575
|
if (typeof fn === 'function') {
|
|
29572
29576
|
const result = fn.call(visitors[i], node, ...rest);
|
|
@@ -29584,7 +29588,7 @@ const mergeAll = (visitors, {
|
|
|
29584
29588
|
},
|
|
29585
29589
|
leave(node, ...rest) {
|
|
29586
29590
|
for (let i = 0; i < visitors.length; i += 1) {
|
|
29587
|
-
if (skipping[i]
|
|
29591
|
+
if (skipping[i] === null) {
|
|
29588
29592
|
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */true);
|
|
29589
29593
|
if (typeof fn === 'function') {
|
|
29590
29594
|
const result = fn.call(visitors[i], node, ...rest);
|
|
@@ -29706,6 +29710,7 @@ visitor, {
|
|
|
29706
29710
|
visitFnGetter = getVisitFn,
|
|
29707
29711
|
nodeTypeGetter = getNodeType,
|
|
29708
29712
|
nodePredicate = isNode,
|
|
29713
|
+
nodeCloneFn = cloneNode,
|
|
29709
29714
|
detectCycles = true
|
|
29710
29715
|
} = {}) => {
|
|
29711
29716
|
const visitorKeys = keyMap || {};
|
|
@@ -29715,15 +29720,14 @@ visitor, {
|
|
|
29715
29720
|
let index = -1;
|
|
29716
29721
|
let parent;
|
|
29717
29722
|
let edits = [];
|
|
29723
|
+
let node = root;
|
|
29718
29724
|
const path = [];
|
|
29719
29725
|
// @ts-ignore
|
|
29720
29726
|
const ancestors = [];
|
|
29721
|
-
let newRoot = root;
|
|
29722
29727
|
do {
|
|
29723
29728
|
index += 1;
|
|
29724
29729
|
const isLeaving = index === keys.length;
|
|
29725
29730
|
let key;
|
|
29726
|
-
let node;
|
|
29727
29731
|
const isEdited = isLeaving && edits.length !== 0;
|
|
29728
29732
|
if (isLeaving) {
|
|
29729
29733
|
key = ancestors.length === 0 ? undefined : path.pop();
|
|
@@ -29732,23 +29736,22 @@ visitor, {
|
|
|
29732
29736
|
parent = ancestors.pop();
|
|
29733
29737
|
if (isEdited) {
|
|
29734
29738
|
if (inArray) {
|
|
29735
|
-
// @ts-ignore
|
|
29739
|
+
// @ts-ignore; creating clone
|
|
29736
29740
|
node = node.slice();
|
|
29741
|
+
let editOffset = 0;
|
|
29742
|
+
for (const [editKey, editValue] of edits) {
|
|
29743
|
+
const arrayKey = editKey - editOffset;
|
|
29744
|
+
if (editValue === deleteNodeSymbol) {
|
|
29745
|
+
node.splice(arrayKey, 1);
|
|
29746
|
+
editOffset += 1;
|
|
29747
|
+
} else {
|
|
29748
|
+
node[arrayKey] = editValue;
|
|
29749
|
+
}
|
|
29750
|
+
}
|
|
29737
29751
|
} else {
|
|
29738
29752
|
// creating clone
|
|
29739
|
-
node =
|
|
29740
|
-
|
|
29741
|
-
let editOffset = 0;
|
|
29742
|
-
for (let ii = 0; ii < edits.length; ii += 1) {
|
|
29743
|
-
let editKey = edits[ii][0];
|
|
29744
|
-
const editValue = edits[ii][1];
|
|
29745
|
-
if (inArray) {
|
|
29746
|
-
editKey -= editOffset;
|
|
29747
|
-
}
|
|
29748
|
-
if (inArray && editValue === deleteNodeSymbol) {
|
|
29749
|
-
node.splice(editKey, 1);
|
|
29750
|
-
editOffset += 1;
|
|
29751
|
-
} else {
|
|
29753
|
+
node = nodeCloneFn(node);
|
|
29754
|
+
for (const [editKey, editValue] of edits) {
|
|
29752
29755
|
node[editKey] = editValue;
|
|
29753
29756
|
}
|
|
29754
29757
|
}
|
|
@@ -29761,15 +29764,13 @@ visitor, {
|
|
|
29761
29764
|
inArray = stack.inArray;
|
|
29762
29765
|
// @ts-ignore
|
|
29763
29766
|
stack = stack.prev;
|
|
29764
|
-
} else {
|
|
29765
|
-
key =
|
|
29766
|
-
node = parent
|
|
29767
|
+
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29768
|
+
key = inArray ? index : keys[index];
|
|
29769
|
+
node = parent[key];
|
|
29767
29770
|
if (node === deleteNodeSymbol || node === undefined) {
|
|
29768
29771
|
continue;
|
|
29769
29772
|
}
|
|
29770
|
-
|
|
29771
|
-
path.push(key);
|
|
29772
|
-
}
|
|
29773
|
+
path.push(key);
|
|
29773
29774
|
}
|
|
29774
29775
|
if (ancestors.includes(node)) {
|
|
29775
29776
|
continue;
|
|
@@ -29779,6 +29780,7 @@ visitor, {
|
|
|
29779
29780
|
if (!nodePredicate(node)) {
|
|
29780
29781
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
29781
29782
|
}
|
|
29783
|
+
|
|
29782
29784
|
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
29783
29785
|
if (detectCycles && ancestors.includes(node)) {
|
|
29784
29786
|
path.pop();
|
|
@@ -29791,25 +29793,26 @@ visitor, {
|
|
|
29791
29793
|
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
29792
29794
|
visitor[stateKey] = stateValue;
|
|
29793
29795
|
}
|
|
29796
|
+
// retrieve result
|
|
29794
29797
|
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
29795
|
-
|
|
29796
|
-
|
|
29798
|
+
}
|
|
29799
|
+
if (result === breakSymbol) {
|
|
29800
|
+
break;
|
|
29801
|
+
}
|
|
29802
|
+
if (result === skipVisitingNodeSymbol) {
|
|
29803
|
+
if (!isLeaving) {
|
|
29804
|
+
path.pop();
|
|
29805
|
+
continue;
|
|
29797
29806
|
}
|
|
29798
|
-
|
|
29799
|
-
|
|
29807
|
+
} else if (result !== undefined) {
|
|
29808
|
+
edits.push([key, result]);
|
|
29809
|
+
if (!isLeaving) {
|
|
29810
|
+
if (nodePredicate(result)) {
|
|
29811
|
+
node = result;
|
|
29812
|
+
} else {
|
|
29800
29813
|
path.pop();
|
|
29801
29814
|
continue;
|
|
29802
29815
|
}
|
|
29803
|
-
} else if (result !== undefined) {
|
|
29804
|
-
edits.push([key, result]);
|
|
29805
|
-
if (!isLeaving) {
|
|
29806
|
-
if (nodePredicate(result)) {
|
|
29807
|
-
node = result;
|
|
29808
|
-
} else {
|
|
29809
|
-
path.pop();
|
|
29810
|
-
continue;
|
|
29811
|
-
}
|
|
29812
|
-
}
|
|
29813
29816
|
}
|
|
29814
29817
|
}
|
|
29815
29818
|
}
|
|
@@ -29817,6 +29820,7 @@ visitor, {
|
|
|
29817
29820
|
edits.push([key, node]);
|
|
29818
29821
|
}
|
|
29819
29822
|
if (!isLeaving) {
|
|
29823
|
+
var _visitorKeys$nodeType;
|
|
29820
29824
|
stack = {
|
|
29821
29825
|
inArray,
|
|
29822
29826
|
index,
|
|
@@ -29826,19 +29830,19 @@ visitor, {
|
|
|
29826
29830
|
};
|
|
29827
29831
|
inArray = Array.isArray(node);
|
|
29828
29832
|
// @ts-ignore
|
|
29829
|
-
keys = inArray ? node : visitorKeys[nodeTypeGetter(node)]
|
|
29833
|
+
keys = inArray ? node : (_visitorKeys$nodeType = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType !== void 0 ? _visitorKeys$nodeType : [];
|
|
29830
29834
|
index = -1;
|
|
29831
29835
|
edits = [];
|
|
29832
|
-
if (parent) {
|
|
29836
|
+
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29833
29837
|
ancestors.push(parent);
|
|
29834
29838
|
}
|
|
29835
29839
|
parent = node;
|
|
29836
29840
|
}
|
|
29837
29841
|
} while (stack !== undefined);
|
|
29838
29842
|
if (edits.length !== 0) {
|
|
29839
|
-
|
|
29843
|
+
return edits.at(-1)[1];
|
|
29840
29844
|
}
|
|
29841
|
-
return
|
|
29845
|
+
return root;
|
|
29842
29846
|
};
|
|
29843
29847
|
|
|
29844
29848
|
/**
|
|
@@ -29858,6 +29862,7 @@ visitor, {
|
|
|
29858
29862
|
visitFnGetter = getVisitFn,
|
|
29859
29863
|
nodeTypeGetter = getNodeType,
|
|
29860
29864
|
nodePredicate = isNode,
|
|
29865
|
+
nodeCloneFn = cloneNode,
|
|
29861
29866
|
detectCycles = true
|
|
29862
29867
|
} = {}) => {
|
|
29863
29868
|
const visitorKeys = keyMap || {};
|
|
@@ -29867,15 +29872,14 @@ visitor, {
|
|
|
29867
29872
|
let index = -1;
|
|
29868
29873
|
let parent;
|
|
29869
29874
|
let edits = [];
|
|
29875
|
+
let node = root;
|
|
29870
29876
|
const path = [];
|
|
29871
29877
|
// @ts-ignore
|
|
29872
29878
|
const ancestors = [];
|
|
29873
|
-
let newRoot = root;
|
|
29874
29879
|
do {
|
|
29875
29880
|
index += 1;
|
|
29876
29881
|
const isLeaving = index === keys.length;
|
|
29877
29882
|
let key;
|
|
29878
|
-
let node;
|
|
29879
29883
|
const isEdited = isLeaving && edits.length !== 0;
|
|
29880
29884
|
if (isLeaving) {
|
|
29881
29885
|
key = ancestors.length === 0 ? undefined : path.pop();
|
|
@@ -29884,23 +29888,22 @@ visitor, {
|
|
|
29884
29888
|
parent = ancestors.pop();
|
|
29885
29889
|
if (isEdited) {
|
|
29886
29890
|
if (inArray) {
|
|
29887
|
-
// @ts-ignore
|
|
29891
|
+
// @ts-ignore; creating clone
|
|
29888
29892
|
node = node.slice();
|
|
29893
|
+
let editOffset = 0;
|
|
29894
|
+
for (const [editKey, editValue] of edits) {
|
|
29895
|
+
const arrayKey = editKey - editOffset;
|
|
29896
|
+
if (editValue === deleteNodeSymbol) {
|
|
29897
|
+
node.splice(arrayKey, 1);
|
|
29898
|
+
editOffset += 1;
|
|
29899
|
+
} else {
|
|
29900
|
+
node[arrayKey] = editValue;
|
|
29901
|
+
}
|
|
29902
|
+
}
|
|
29889
29903
|
} else {
|
|
29890
29904
|
// creating clone
|
|
29891
|
-
node =
|
|
29892
|
-
|
|
29893
|
-
let editOffset = 0;
|
|
29894
|
-
for (let ii = 0; ii < edits.length; ii += 1) {
|
|
29895
|
-
let editKey = edits[ii][0];
|
|
29896
|
-
const editValue = edits[ii][1];
|
|
29897
|
-
if (inArray) {
|
|
29898
|
-
editKey -= editOffset;
|
|
29899
|
-
}
|
|
29900
|
-
if (inArray && editValue === deleteNodeSymbol) {
|
|
29901
|
-
node.splice(editKey, 1);
|
|
29902
|
-
editOffset += 1;
|
|
29903
|
-
} else {
|
|
29905
|
+
node = nodeCloneFn(node);
|
|
29906
|
+
for (const [editKey, editValue] of edits) {
|
|
29904
29907
|
node[editKey] = editValue;
|
|
29905
29908
|
}
|
|
29906
29909
|
}
|
|
@@ -29913,21 +29916,20 @@ visitor, {
|
|
|
29913
29916
|
inArray = stack.inArray;
|
|
29914
29917
|
// @ts-ignore
|
|
29915
29918
|
stack = stack.prev;
|
|
29916
|
-
} else {
|
|
29917
|
-
key =
|
|
29918
|
-
node = parent
|
|
29919
|
+
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29920
|
+
key = inArray ? index : keys[index];
|
|
29921
|
+
node = parent[key];
|
|
29919
29922
|
if (node === deleteNodeSymbol || node === undefined) {
|
|
29920
29923
|
continue;
|
|
29921
29924
|
}
|
|
29922
|
-
|
|
29923
|
-
path.push(key);
|
|
29924
|
-
}
|
|
29925
|
+
path.push(key);
|
|
29925
29926
|
}
|
|
29926
29927
|
let result;
|
|
29927
29928
|
if (!Array.isArray(node)) {
|
|
29928
29929
|
if (!nodePredicate(node)) {
|
|
29929
29930
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
29930
29931
|
}
|
|
29932
|
+
|
|
29931
29933
|
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
29932
29934
|
if (detectCycles && ancestors.includes(node)) {
|
|
29933
29935
|
path.pop();
|
|
@@ -29940,26 +29942,27 @@ visitor, {
|
|
|
29940
29942
|
visitor[stateKey] = stateValue;
|
|
29941
29943
|
}
|
|
29942
29944
|
|
|
29943
|
-
//
|
|
29944
|
-
result = await visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
29945
|
-
|
|
29946
|
-
|
|
29945
|
+
// retrieve result
|
|
29946
|
+
result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
|
|
29947
|
+
}
|
|
29948
|
+
|
|
29949
|
+
if (result === breakSymbol) {
|
|
29950
|
+
break;
|
|
29951
|
+
}
|
|
29952
|
+
if (result === skipVisitingNodeSymbol) {
|
|
29953
|
+
if (!isLeaving) {
|
|
29954
|
+
path.pop();
|
|
29955
|
+
continue;
|
|
29947
29956
|
}
|
|
29948
|
-
|
|
29949
|
-
|
|
29957
|
+
} else if (result !== undefined) {
|
|
29958
|
+
edits.push([key, result]);
|
|
29959
|
+
if (!isLeaving) {
|
|
29960
|
+
if (nodePredicate(result)) {
|
|
29961
|
+
node = result;
|
|
29962
|
+
} else {
|
|
29950
29963
|
path.pop();
|
|
29951
29964
|
continue;
|
|
29952
29965
|
}
|
|
29953
|
-
} else if (result !== undefined) {
|
|
29954
|
-
edits.push([key, result]);
|
|
29955
|
-
if (!isLeaving) {
|
|
29956
|
-
if (nodePredicate(result)) {
|
|
29957
|
-
node = result;
|
|
29958
|
-
} else {
|
|
29959
|
-
path.pop();
|
|
29960
|
-
continue;
|
|
29961
|
-
}
|
|
29962
|
-
}
|
|
29963
29966
|
}
|
|
29964
29967
|
}
|
|
29965
29968
|
}
|
|
@@ -29967,6 +29970,7 @@ visitor, {
|
|
|
29967
29970
|
edits.push([key, node]);
|
|
29968
29971
|
}
|
|
29969
29972
|
if (!isLeaving) {
|
|
29973
|
+
var _visitorKeys$nodeType2;
|
|
29970
29974
|
stack = {
|
|
29971
29975
|
inArray,
|
|
29972
29976
|
index,
|
|
@@ -29976,19 +29980,19 @@ visitor, {
|
|
|
29976
29980
|
};
|
|
29977
29981
|
inArray = Array.isArray(node);
|
|
29978
29982
|
// @ts-ignore
|
|
29979
|
-
keys = inArray ? node : visitorKeys[nodeTypeGetter(node)]
|
|
29983
|
+
keys = inArray ? node : (_visitorKeys$nodeType2 = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType2 !== void 0 ? _visitorKeys$nodeType2 : [];
|
|
29980
29984
|
index = -1;
|
|
29981
29985
|
edits = [];
|
|
29982
|
-
if (parent) {
|
|
29986
|
+
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29983
29987
|
ancestors.push(parent);
|
|
29984
29988
|
}
|
|
29985
29989
|
parent = node;
|
|
29986
29990
|
}
|
|
29987
29991
|
} while (stack !== undefined);
|
|
29988
29992
|
if (edits.length !== 0) {
|
|
29989
|
-
|
|
29993
|
+
return edits.at(-1)[1];
|
|
29990
29994
|
}
|
|
29991
|
-
return
|
|
29995
|
+
return root;
|
|
29992
29996
|
};
|
|
29993
29997
|
|
|
29994
29998
|
/* eslint-enable */
|
|
@@ -31149,6 +31153,165 @@ const JsonSchema = stampit__WEBPACK_IMPORTED_MODULE_0__(_failsafe_index_mjs__WEB
|
|
|
31149
31153
|
|
|
31150
31154
|
/***/ }),
|
|
31151
31155
|
|
|
31156
|
+
/***/ 19815:
|
|
31157
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
31158
|
+
|
|
31159
|
+
"use strict";
|
|
31160
|
+
__webpack_require__.r(__webpack_exports__);
|
|
31161
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31162
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
31163
|
+
/* harmony export */ });
|
|
31164
|
+
/* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69985);
|
|
31165
|
+
|
|
31166
|
+
class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
31167
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CloneError);
|
|
31168
|
+
|
|
31169
|
+
/***/ }),
|
|
31170
|
+
|
|
31171
|
+
/***/ 34646:
|
|
31172
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
31173
|
+
|
|
31174
|
+
"use strict";
|
|
31175
|
+
__webpack_require__.r(__webpack_exports__);
|
|
31176
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31177
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
31178
|
+
/* harmony export */ });
|
|
31179
|
+
/* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19815);
|
|
31180
|
+
|
|
31181
|
+
class DeepCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
31182
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeepCloneError);
|
|
31183
|
+
|
|
31184
|
+
/***/ }),
|
|
31185
|
+
|
|
31186
|
+
/***/ 10219:
|
|
31187
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
31188
|
+
|
|
31189
|
+
"use strict";
|
|
31190
|
+
__webpack_require__.r(__webpack_exports__);
|
|
31191
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31192
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
31193
|
+
/* harmony export */ });
|
|
31194
|
+
/* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19815);
|
|
31195
|
+
|
|
31196
|
+
class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
31197
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShallowCloneError);
|
|
31198
|
+
|
|
31199
|
+
/***/ }),
|
|
31200
|
+
|
|
31201
|
+
/***/ 82434:
|
|
31202
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
31203
|
+
|
|
31204
|
+
"use strict";
|
|
31205
|
+
__webpack_require__.r(__webpack_exports__);
|
|
31206
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31207
|
+
/* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
|
|
31208
|
+
/* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
|
|
31209
|
+
/* harmony export */ });
|
|
31210
|
+
/* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67952);
|
|
31211
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36903);
|
|
31212
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34646);
|
|
31213
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10219);
|
|
31214
|
+
|
|
31215
|
+
|
|
31216
|
+
|
|
31217
|
+
|
|
31218
|
+
const invokeClone = value => {
|
|
31219
|
+
if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
|
|
31220
|
+
return value.clone();
|
|
31221
|
+
}
|
|
31222
|
+
return value;
|
|
31223
|
+
};
|
|
31224
|
+
const cloneDeep = value => {
|
|
31225
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
|
|
31226
|
+
const items = [...value].map(invokeClone);
|
|
31227
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
|
|
31228
|
+
}
|
|
31229
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
31230
|
+
const items = [...value].map(invokeClone);
|
|
31231
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
|
|
31232
|
+
}
|
|
31233
|
+
if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
|
|
31234
|
+
return value.clone();
|
|
31235
|
+
}
|
|
31236
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
31237
|
+
value
|
|
31238
|
+
});
|
|
31239
|
+
};
|
|
31240
|
+
cloneDeep.safe = value => {
|
|
31241
|
+
try {
|
|
31242
|
+
return cloneDeep(value);
|
|
31243
|
+
} catch {
|
|
31244
|
+
return value;
|
|
31245
|
+
}
|
|
31246
|
+
};
|
|
31247
|
+
const cloneShallowKeyValuePair = keyValuePair => {
|
|
31248
|
+
const {
|
|
31249
|
+
key,
|
|
31250
|
+
value
|
|
31251
|
+
} = keyValuePair;
|
|
31252
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair(key, value);
|
|
31253
|
+
};
|
|
31254
|
+
const cloneShallowArraySlice = arraySlice => {
|
|
31255
|
+
const items = [...arraySlice];
|
|
31256
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
|
|
31257
|
+
};
|
|
31258
|
+
const cloneShallowObjectSlice = objectSlice => {
|
|
31259
|
+
const items = [...objectSlice];
|
|
31260
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
|
|
31261
|
+
};
|
|
31262
|
+
|
|
31263
|
+
/* eslint-disable no-underscore-dangle */
|
|
31264
|
+
const cloneShallowElement = element => {
|
|
31265
|
+
// @ts-ignore
|
|
31266
|
+
const copy = new element.constructor();
|
|
31267
|
+
copy.element = element.element;
|
|
31268
|
+
if (element.meta.length > 0) {
|
|
31269
|
+
copy._meta = cloneDeep(element.meta);
|
|
31270
|
+
}
|
|
31271
|
+
if (element.attributes.length > 0) {
|
|
31272
|
+
copy._attributes = cloneDeep(element.attributes);
|
|
31273
|
+
}
|
|
31274
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(element.content)) {
|
|
31275
|
+
const content = element.content;
|
|
31276
|
+
copy.content = cloneShallowElement(content);
|
|
31277
|
+
} else if (Array.isArray(element.content)) {
|
|
31278
|
+
copy.content = [...element.content];
|
|
31279
|
+
} else if (element.content instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
31280
|
+
copy.content = cloneShallowKeyValuePair(element.content);
|
|
31281
|
+
} else {
|
|
31282
|
+
copy.content = element.content;
|
|
31283
|
+
}
|
|
31284
|
+
return copy;
|
|
31285
|
+
};
|
|
31286
|
+
/* eslint-enable */
|
|
31287
|
+
|
|
31288
|
+
const cloneShallow = value => {
|
|
31289
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
31290
|
+
return cloneShallowKeyValuePair(value);
|
|
31291
|
+
}
|
|
31292
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
|
|
31293
|
+
return cloneShallowObjectSlice(value);
|
|
31294
|
+
}
|
|
31295
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
31296
|
+
return cloneShallowArraySlice(value);
|
|
31297
|
+
}
|
|
31298
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(value)) {
|
|
31299
|
+
return cloneShallowElement(value);
|
|
31300
|
+
}
|
|
31301
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
31302
|
+
value
|
|
31303
|
+
});
|
|
31304
|
+
};
|
|
31305
|
+
cloneShallow.safe = value => {
|
|
31306
|
+
try {
|
|
31307
|
+
return cloneShallow(value);
|
|
31308
|
+
} catch {
|
|
31309
|
+
return value;
|
|
31310
|
+
}
|
|
31311
|
+
};
|
|
31312
|
+
|
|
31313
|
+
/***/ }),
|
|
31314
|
+
|
|
31152
31315
|
/***/ 12472:
|
|
31153
31316
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
31154
31317
|
|
|
@@ -31721,6 +31884,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31721
31884
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31722
31885
|
/* harmony export */ BREAK: () => (/* reexport safe */ _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__.BREAK),
|
|
31723
31886
|
/* harmony export */ PredicateVisitor: () => (/* binding */ PredicateVisitor),
|
|
31887
|
+
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
31724
31888
|
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
31725
31889
|
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
31726
31890
|
/* harmony export */ keyMapDefault: () => (/* binding */ keyMapDefault),
|
|
@@ -31729,9 +31893,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31729
31893
|
/* harmony export */ });
|
|
31730
31894
|
/* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
|
|
31731
31895
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13776);
|
|
31732
|
-
/* harmony import */ var
|
|
31896
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25992);
|
|
31733
31897
|
/* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51394);
|
|
31734
31898
|
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36903);
|
|
31899
|
+
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82434);
|
|
31900
|
+
|
|
31735
31901
|
|
|
31736
31902
|
|
|
31737
31903
|
|
|
@@ -31753,8 +31919,16 @@ const getNodeType = element => {
|
|
|
31753
31919
|
/* eslint-enable */
|
|
31754
31920
|
};
|
|
31755
31921
|
|
|
31922
|
+
// cloneNode :: a -> a
|
|
31923
|
+
const cloneNode = node => {
|
|
31924
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(node)) {
|
|
31925
|
+
return (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(node);
|
|
31926
|
+
}
|
|
31927
|
+
return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__.cloneNode)(node);
|
|
31928
|
+
};
|
|
31929
|
+
|
|
31756
31930
|
// isNode :: Node -> Boolean
|
|
31757
|
-
const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_1__.pipe)(getNodeType,
|
|
31931
|
+
const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_1__.pipe)(getNodeType, ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"]);
|
|
31758
31932
|
const keyMapDefault = {
|
|
31759
31933
|
ObjectElement: ['content'],
|
|
31760
31934
|
ArrayElement: ['content'],
|
|
@@ -31815,6 +31989,7 @@ visitor, {
|
|
|
31815
31989
|
// @ts-ignore
|
|
31816
31990
|
nodeTypeGetter: getNodeType,
|
|
31817
31991
|
nodePredicate: isNode,
|
|
31992
|
+
nodeCloneFn: cloneNode,
|
|
31818
31993
|
...rest
|
|
31819
31994
|
});
|
|
31820
31995
|
};
|
|
@@ -31833,6 +32008,7 @@ visitor, {
|
|
|
31833
32008
|
// @ts-ignore
|
|
31834
32009
|
nodeTypeGetter: getNodeType,
|
|
31835
32010
|
nodePredicate: isNode,
|
|
32011
|
+
nodeCloneFn: cloneNode,
|
|
31836
32012
|
...rest
|
|
31837
32013
|
});
|
|
31838
32014
|
};
|
|
@@ -31902,7 +32078,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31902
32078
|
class ApiDOMError extends Error {
|
|
31903
32079
|
static [Symbol.hasInstance](instance) {
|
|
31904
32080
|
// we want to ApiDOMAggregateError to act as if ApiDOMError was its superclass
|
|
31905
|
-
return
|
|
32081
|
+
return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(_ApiDOMAggregateError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"], instance);
|
|
31906
32082
|
}
|
|
31907
32083
|
constructor(message, options) {
|
|
31908
32084
|
super(message, options);
|