@swagger-api/apidom-parser-adapter-json 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 +3 -5
- 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/direct/index.cjs +1 -2
- package/cjs/syntactic-analysis/direct/visitors/CstVisitor.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/JsonAstVisitor.cjs +2 -4
- package/dist/apidom-parser-adapter-json.browser.js +288 -88
- package/dist/apidom-parser-adapter-json.browser.min.js +1 -1
- package/package.json +5 -5
|
@@ -28904,6 +28904,7 @@ const isParseResult = isNodeType.bind(undefined, 'parseResult');
|
|
|
28904
28904
|
__webpack_require__.r(__webpack_exports__);
|
|
28905
28905
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
28906
28906
|
/* harmony export */ BREAK: () => (/* binding */ BREAK),
|
|
28907
|
+
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
28907
28908
|
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
28908
28909
|
/* harmony export */ getVisitFn: () => (/* binding */ getVisitFn),
|
|
28909
28910
|
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
@@ -28956,6 +28957,9 @@ const getNodeType = node => node === null || node === void 0 ? void 0 : node.typ
|
|
|
28956
28957
|
// isNode :: Node -> Boolean
|
|
28957
28958
|
const isNode = node => typeof getNodeType(node) === 'string';
|
|
28958
28959
|
|
|
28960
|
+
// cloneNode :: a -> a
|
|
28961
|
+
const cloneNode = node => Object.create(Object.getPrototypeOf(node), Object.getOwnPropertyDescriptors(node));
|
|
28962
|
+
|
|
28959
28963
|
/**
|
|
28960
28964
|
* Creates a new visitor instance which delegates to many visitors to run in
|
|
28961
28965
|
* parallel. Each visitor will be visited for each node before moving on.
|
|
@@ -28966,11 +28970,11 @@ const mergeAll = (visitors, {
|
|
|
28966
28970
|
visitFnGetter = getVisitFn,
|
|
28967
28971
|
nodeTypeGetter = getNodeType
|
|
28968
28972
|
} = {}) => {
|
|
28969
|
-
const skipping = new Array(visitors.length);
|
|
28973
|
+
const skipping = new Array(visitors.length).fill(null);
|
|
28970
28974
|
return {
|
|
28971
28975
|
enter(node, ...rest) {
|
|
28972
28976
|
for (let i = 0; i < visitors.length; i += 1) {
|
|
28973
|
-
if (skipping[i]
|
|
28977
|
+
if (skipping[i] === null) {
|
|
28974
28978
|
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */false);
|
|
28975
28979
|
if (typeof fn === 'function') {
|
|
28976
28980
|
const result = fn.call(visitors[i], node, ...rest);
|
|
@@ -28988,7 +28992,7 @@ const mergeAll = (visitors, {
|
|
|
28988
28992
|
},
|
|
28989
28993
|
leave(node, ...rest) {
|
|
28990
28994
|
for (let i = 0; i < visitors.length; i += 1) {
|
|
28991
|
-
if (skipping[i]
|
|
28995
|
+
if (skipping[i] === null) {
|
|
28992
28996
|
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */true);
|
|
28993
28997
|
if (typeof fn === 'function') {
|
|
28994
28998
|
const result = fn.call(visitors[i], node, ...rest);
|
|
@@ -29110,6 +29114,7 @@ visitor, {
|
|
|
29110
29114
|
visitFnGetter = getVisitFn,
|
|
29111
29115
|
nodeTypeGetter = getNodeType,
|
|
29112
29116
|
nodePredicate = isNode,
|
|
29117
|
+
nodeCloneFn = cloneNode,
|
|
29113
29118
|
detectCycles = true
|
|
29114
29119
|
} = {}) => {
|
|
29115
29120
|
const visitorKeys = keyMap || {};
|
|
@@ -29119,15 +29124,14 @@ visitor, {
|
|
|
29119
29124
|
let index = -1;
|
|
29120
29125
|
let parent;
|
|
29121
29126
|
let edits = [];
|
|
29127
|
+
let node = root;
|
|
29122
29128
|
const path = [];
|
|
29123
29129
|
// @ts-ignore
|
|
29124
29130
|
const ancestors = [];
|
|
29125
|
-
let newRoot = root;
|
|
29126
29131
|
do {
|
|
29127
29132
|
index += 1;
|
|
29128
29133
|
const isLeaving = index === keys.length;
|
|
29129
29134
|
let key;
|
|
29130
|
-
let node;
|
|
29131
29135
|
const isEdited = isLeaving && edits.length !== 0;
|
|
29132
29136
|
if (isLeaving) {
|
|
29133
29137
|
key = ancestors.length === 0 ? undefined : path.pop();
|
|
@@ -29136,23 +29140,22 @@ visitor, {
|
|
|
29136
29140
|
parent = ancestors.pop();
|
|
29137
29141
|
if (isEdited) {
|
|
29138
29142
|
if (inArray) {
|
|
29139
|
-
// @ts-ignore
|
|
29143
|
+
// @ts-ignore; creating clone
|
|
29140
29144
|
node = node.slice();
|
|
29145
|
+
let editOffset = 0;
|
|
29146
|
+
for (const [editKey, editValue] of edits) {
|
|
29147
|
+
const arrayKey = editKey - editOffset;
|
|
29148
|
+
if (editValue === deleteNodeSymbol) {
|
|
29149
|
+
node.splice(arrayKey, 1);
|
|
29150
|
+
editOffset += 1;
|
|
29151
|
+
} else {
|
|
29152
|
+
node[arrayKey] = editValue;
|
|
29153
|
+
}
|
|
29154
|
+
}
|
|
29141
29155
|
} else {
|
|
29142
29156
|
// creating clone
|
|
29143
|
-
node =
|
|
29144
|
-
|
|
29145
|
-
let editOffset = 0;
|
|
29146
|
-
for (let ii = 0; ii < edits.length; ii += 1) {
|
|
29147
|
-
let editKey = edits[ii][0];
|
|
29148
|
-
const editValue = edits[ii][1];
|
|
29149
|
-
if (inArray) {
|
|
29150
|
-
editKey -= editOffset;
|
|
29151
|
-
}
|
|
29152
|
-
if (inArray && editValue === deleteNodeSymbol) {
|
|
29153
|
-
node.splice(editKey, 1);
|
|
29154
|
-
editOffset += 1;
|
|
29155
|
-
} else {
|
|
29157
|
+
node = nodeCloneFn(node);
|
|
29158
|
+
for (const [editKey, editValue] of edits) {
|
|
29156
29159
|
node[editKey] = editValue;
|
|
29157
29160
|
}
|
|
29158
29161
|
}
|
|
@@ -29165,15 +29168,13 @@ visitor, {
|
|
|
29165
29168
|
inArray = stack.inArray;
|
|
29166
29169
|
// @ts-ignore
|
|
29167
29170
|
stack = stack.prev;
|
|
29168
|
-
} else {
|
|
29169
|
-
key =
|
|
29170
|
-
node = parent
|
|
29171
|
+
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29172
|
+
key = inArray ? index : keys[index];
|
|
29173
|
+
node = parent[key];
|
|
29171
29174
|
if (node === deleteNodeSymbol || node === undefined) {
|
|
29172
29175
|
continue;
|
|
29173
29176
|
}
|
|
29174
|
-
|
|
29175
|
-
path.push(key);
|
|
29176
|
-
}
|
|
29177
|
+
path.push(key);
|
|
29177
29178
|
}
|
|
29178
29179
|
if (ancestors.includes(node)) {
|
|
29179
29180
|
continue;
|
|
@@ -29183,6 +29184,7 @@ visitor, {
|
|
|
29183
29184
|
if (!nodePredicate(node)) {
|
|
29184
29185
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
29185
29186
|
}
|
|
29187
|
+
|
|
29186
29188
|
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
29187
29189
|
if (detectCycles && ancestors.includes(node)) {
|
|
29188
29190
|
path.pop();
|
|
@@ -29195,25 +29197,26 @@ visitor, {
|
|
|
29195
29197
|
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
29196
29198
|
visitor[stateKey] = stateValue;
|
|
29197
29199
|
}
|
|
29200
|
+
// retrieve result
|
|
29198
29201
|
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
29199
|
-
|
|
29200
|
-
|
|
29202
|
+
}
|
|
29203
|
+
if (result === breakSymbol) {
|
|
29204
|
+
break;
|
|
29205
|
+
}
|
|
29206
|
+
if (result === skipVisitingNodeSymbol) {
|
|
29207
|
+
if (!isLeaving) {
|
|
29208
|
+
path.pop();
|
|
29209
|
+
continue;
|
|
29201
29210
|
}
|
|
29202
|
-
|
|
29203
|
-
|
|
29211
|
+
} else if (result !== undefined) {
|
|
29212
|
+
edits.push([key, result]);
|
|
29213
|
+
if (!isLeaving) {
|
|
29214
|
+
if (nodePredicate(result)) {
|
|
29215
|
+
node = result;
|
|
29216
|
+
} else {
|
|
29204
29217
|
path.pop();
|
|
29205
29218
|
continue;
|
|
29206
29219
|
}
|
|
29207
|
-
} else if (result !== undefined) {
|
|
29208
|
-
edits.push([key, result]);
|
|
29209
|
-
if (!isLeaving) {
|
|
29210
|
-
if (nodePredicate(result)) {
|
|
29211
|
-
node = result;
|
|
29212
|
-
} else {
|
|
29213
|
-
path.pop();
|
|
29214
|
-
continue;
|
|
29215
|
-
}
|
|
29216
|
-
}
|
|
29217
29220
|
}
|
|
29218
29221
|
}
|
|
29219
29222
|
}
|
|
@@ -29221,6 +29224,7 @@ visitor, {
|
|
|
29221
29224
|
edits.push([key, node]);
|
|
29222
29225
|
}
|
|
29223
29226
|
if (!isLeaving) {
|
|
29227
|
+
var _visitorKeys$nodeType;
|
|
29224
29228
|
stack = {
|
|
29225
29229
|
inArray,
|
|
29226
29230
|
index,
|
|
@@ -29230,19 +29234,19 @@ visitor, {
|
|
|
29230
29234
|
};
|
|
29231
29235
|
inArray = Array.isArray(node);
|
|
29232
29236
|
// @ts-ignore
|
|
29233
|
-
keys = inArray ? node : visitorKeys[nodeTypeGetter(node)]
|
|
29237
|
+
keys = inArray ? node : (_visitorKeys$nodeType = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType !== void 0 ? _visitorKeys$nodeType : [];
|
|
29234
29238
|
index = -1;
|
|
29235
29239
|
edits = [];
|
|
29236
|
-
if (parent) {
|
|
29240
|
+
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29237
29241
|
ancestors.push(parent);
|
|
29238
29242
|
}
|
|
29239
29243
|
parent = node;
|
|
29240
29244
|
}
|
|
29241
29245
|
} while (stack !== undefined);
|
|
29242
29246
|
if (edits.length !== 0) {
|
|
29243
|
-
|
|
29247
|
+
return edits.at(-1)[1];
|
|
29244
29248
|
}
|
|
29245
|
-
return
|
|
29249
|
+
return root;
|
|
29246
29250
|
};
|
|
29247
29251
|
|
|
29248
29252
|
/**
|
|
@@ -29262,6 +29266,7 @@ visitor, {
|
|
|
29262
29266
|
visitFnGetter = getVisitFn,
|
|
29263
29267
|
nodeTypeGetter = getNodeType,
|
|
29264
29268
|
nodePredicate = isNode,
|
|
29269
|
+
nodeCloneFn = cloneNode,
|
|
29265
29270
|
detectCycles = true
|
|
29266
29271
|
} = {}) => {
|
|
29267
29272
|
const visitorKeys = keyMap || {};
|
|
@@ -29271,15 +29276,14 @@ visitor, {
|
|
|
29271
29276
|
let index = -1;
|
|
29272
29277
|
let parent;
|
|
29273
29278
|
let edits = [];
|
|
29279
|
+
let node = root;
|
|
29274
29280
|
const path = [];
|
|
29275
29281
|
// @ts-ignore
|
|
29276
29282
|
const ancestors = [];
|
|
29277
|
-
let newRoot = root;
|
|
29278
29283
|
do {
|
|
29279
29284
|
index += 1;
|
|
29280
29285
|
const isLeaving = index === keys.length;
|
|
29281
29286
|
let key;
|
|
29282
|
-
let node;
|
|
29283
29287
|
const isEdited = isLeaving && edits.length !== 0;
|
|
29284
29288
|
if (isLeaving) {
|
|
29285
29289
|
key = ancestors.length === 0 ? undefined : path.pop();
|
|
@@ -29288,23 +29292,22 @@ visitor, {
|
|
|
29288
29292
|
parent = ancestors.pop();
|
|
29289
29293
|
if (isEdited) {
|
|
29290
29294
|
if (inArray) {
|
|
29291
|
-
// @ts-ignore
|
|
29295
|
+
// @ts-ignore; creating clone
|
|
29292
29296
|
node = node.slice();
|
|
29297
|
+
let editOffset = 0;
|
|
29298
|
+
for (const [editKey, editValue] of edits) {
|
|
29299
|
+
const arrayKey = editKey - editOffset;
|
|
29300
|
+
if (editValue === deleteNodeSymbol) {
|
|
29301
|
+
node.splice(arrayKey, 1);
|
|
29302
|
+
editOffset += 1;
|
|
29303
|
+
} else {
|
|
29304
|
+
node[arrayKey] = editValue;
|
|
29305
|
+
}
|
|
29306
|
+
}
|
|
29293
29307
|
} else {
|
|
29294
29308
|
// creating clone
|
|
29295
|
-
node =
|
|
29296
|
-
|
|
29297
|
-
let editOffset = 0;
|
|
29298
|
-
for (let ii = 0; ii < edits.length; ii += 1) {
|
|
29299
|
-
let editKey = edits[ii][0];
|
|
29300
|
-
const editValue = edits[ii][1];
|
|
29301
|
-
if (inArray) {
|
|
29302
|
-
editKey -= editOffset;
|
|
29303
|
-
}
|
|
29304
|
-
if (inArray && editValue === deleteNodeSymbol) {
|
|
29305
|
-
node.splice(editKey, 1);
|
|
29306
|
-
editOffset += 1;
|
|
29307
|
-
} else {
|
|
29309
|
+
node = nodeCloneFn(node);
|
|
29310
|
+
for (const [editKey, editValue] of edits) {
|
|
29308
29311
|
node[editKey] = editValue;
|
|
29309
29312
|
}
|
|
29310
29313
|
}
|
|
@@ -29317,21 +29320,20 @@ visitor, {
|
|
|
29317
29320
|
inArray = stack.inArray;
|
|
29318
29321
|
// @ts-ignore
|
|
29319
29322
|
stack = stack.prev;
|
|
29320
|
-
} else {
|
|
29321
|
-
key =
|
|
29322
|
-
node = parent
|
|
29323
|
+
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29324
|
+
key = inArray ? index : keys[index];
|
|
29325
|
+
node = parent[key];
|
|
29323
29326
|
if (node === deleteNodeSymbol || node === undefined) {
|
|
29324
29327
|
continue;
|
|
29325
29328
|
}
|
|
29326
|
-
|
|
29327
|
-
path.push(key);
|
|
29328
|
-
}
|
|
29329
|
+
path.push(key);
|
|
29329
29330
|
}
|
|
29330
29331
|
let result;
|
|
29331
29332
|
if (!Array.isArray(node)) {
|
|
29332
29333
|
if (!nodePredicate(node)) {
|
|
29333
29334
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
29334
29335
|
}
|
|
29336
|
+
|
|
29335
29337
|
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
29336
29338
|
if (detectCycles && ancestors.includes(node)) {
|
|
29337
29339
|
path.pop();
|
|
@@ -29344,26 +29346,27 @@ visitor, {
|
|
|
29344
29346
|
visitor[stateKey] = stateValue;
|
|
29345
29347
|
}
|
|
29346
29348
|
|
|
29347
|
-
//
|
|
29348
|
-
result = await visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
29349
|
-
|
|
29350
|
-
|
|
29349
|
+
// retrieve result
|
|
29350
|
+
result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
|
|
29351
|
+
}
|
|
29352
|
+
|
|
29353
|
+
if (result === breakSymbol) {
|
|
29354
|
+
break;
|
|
29355
|
+
}
|
|
29356
|
+
if (result === skipVisitingNodeSymbol) {
|
|
29357
|
+
if (!isLeaving) {
|
|
29358
|
+
path.pop();
|
|
29359
|
+
continue;
|
|
29351
29360
|
}
|
|
29352
|
-
|
|
29353
|
-
|
|
29361
|
+
} else if (result !== undefined) {
|
|
29362
|
+
edits.push([key, result]);
|
|
29363
|
+
if (!isLeaving) {
|
|
29364
|
+
if (nodePredicate(result)) {
|
|
29365
|
+
node = result;
|
|
29366
|
+
} else {
|
|
29354
29367
|
path.pop();
|
|
29355
29368
|
continue;
|
|
29356
29369
|
}
|
|
29357
|
-
} else if (result !== undefined) {
|
|
29358
|
-
edits.push([key, result]);
|
|
29359
|
-
if (!isLeaving) {
|
|
29360
|
-
if (nodePredicate(result)) {
|
|
29361
|
-
node = result;
|
|
29362
|
-
} else {
|
|
29363
|
-
path.pop();
|
|
29364
|
-
continue;
|
|
29365
|
-
}
|
|
29366
|
-
}
|
|
29367
29370
|
}
|
|
29368
29371
|
}
|
|
29369
29372
|
}
|
|
@@ -29371,6 +29374,7 @@ visitor, {
|
|
|
29371
29374
|
edits.push([key, node]);
|
|
29372
29375
|
}
|
|
29373
29376
|
if (!isLeaving) {
|
|
29377
|
+
var _visitorKeys$nodeType2;
|
|
29374
29378
|
stack = {
|
|
29375
29379
|
inArray,
|
|
29376
29380
|
index,
|
|
@@ -29380,25 +29384,184 @@ visitor, {
|
|
|
29380
29384
|
};
|
|
29381
29385
|
inArray = Array.isArray(node);
|
|
29382
29386
|
// @ts-ignore
|
|
29383
|
-
keys = inArray ? node : visitorKeys[nodeTypeGetter(node)]
|
|
29387
|
+
keys = inArray ? node : (_visitorKeys$nodeType2 = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType2 !== void 0 ? _visitorKeys$nodeType2 : [];
|
|
29384
29388
|
index = -1;
|
|
29385
29389
|
edits = [];
|
|
29386
|
-
if (parent) {
|
|
29390
|
+
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
29387
29391
|
ancestors.push(parent);
|
|
29388
29392
|
}
|
|
29389
29393
|
parent = node;
|
|
29390
29394
|
}
|
|
29391
29395
|
} while (stack !== undefined);
|
|
29392
29396
|
if (edits.length !== 0) {
|
|
29393
|
-
|
|
29397
|
+
return edits.at(-1)[1];
|
|
29394
29398
|
}
|
|
29395
|
-
return
|
|
29399
|
+
return root;
|
|
29396
29400
|
};
|
|
29397
29401
|
|
|
29398
29402
|
/* eslint-enable */
|
|
29399
29403
|
|
|
29400
29404
|
/***/ }),
|
|
29401
29405
|
|
|
29406
|
+
/***/ 19815:
|
|
29407
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
29408
|
+
|
|
29409
|
+
"use strict";
|
|
29410
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29411
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29412
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
29413
|
+
/* harmony export */ });
|
|
29414
|
+
/* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69985);
|
|
29415
|
+
|
|
29416
|
+
class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
29417
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CloneError);
|
|
29418
|
+
|
|
29419
|
+
/***/ }),
|
|
29420
|
+
|
|
29421
|
+
/***/ 34646:
|
|
29422
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
29423
|
+
|
|
29424
|
+
"use strict";
|
|
29425
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29426
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29427
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
29428
|
+
/* harmony export */ });
|
|
29429
|
+
/* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19815);
|
|
29430
|
+
|
|
29431
|
+
class DeepCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
29432
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeepCloneError);
|
|
29433
|
+
|
|
29434
|
+
/***/ }),
|
|
29435
|
+
|
|
29436
|
+
/***/ 10219:
|
|
29437
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
29438
|
+
|
|
29439
|
+
"use strict";
|
|
29440
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29441
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29442
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
29443
|
+
/* harmony export */ });
|
|
29444
|
+
/* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19815);
|
|
29445
|
+
|
|
29446
|
+
class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
|
|
29447
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShallowCloneError);
|
|
29448
|
+
|
|
29449
|
+
/***/ }),
|
|
29450
|
+
|
|
29451
|
+
/***/ 82434:
|
|
29452
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
29453
|
+
|
|
29454
|
+
"use strict";
|
|
29455
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29456
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29457
|
+
/* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
|
|
29458
|
+
/* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
|
|
29459
|
+
/* harmony export */ });
|
|
29460
|
+
/* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67952);
|
|
29461
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36903);
|
|
29462
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34646);
|
|
29463
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10219);
|
|
29464
|
+
|
|
29465
|
+
|
|
29466
|
+
|
|
29467
|
+
|
|
29468
|
+
const invokeClone = value => {
|
|
29469
|
+
if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
|
|
29470
|
+
return value.clone();
|
|
29471
|
+
}
|
|
29472
|
+
return value;
|
|
29473
|
+
};
|
|
29474
|
+
const cloneDeep = value => {
|
|
29475
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
|
|
29476
|
+
const items = [...value].map(invokeClone);
|
|
29477
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
|
|
29478
|
+
}
|
|
29479
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
29480
|
+
const items = [...value].map(invokeClone);
|
|
29481
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
|
|
29482
|
+
}
|
|
29483
|
+
if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
|
|
29484
|
+
return value.clone();
|
|
29485
|
+
}
|
|
29486
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
29487
|
+
value
|
|
29488
|
+
});
|
|
29489
|
+
};
|
|
29490
|
+
cloneDeep.safe = value => {
|
|
29491
|
+
try {
|
|
29492
|
+
return cloneDeep(value);
|
|
29493
|
+
} catch {
|
|
29494
|
+
return value;
|
|
29495
|
+
}
|
|
29496
|
+
};
|
|
29497
|
+
const cloneShallowKeyValuePair = keyValuePair => {
|
|
29498
|
+
const {
|
|
29499
|
+
key,
|
|
29500
|
+
value
|
|
29501
|
+
} = keyValuePair;
|
|
29502
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair(key, value);
|
|
29503
|
+
};
|
|
29504
|
+
const cloneShallowArraySlice = arraySlice => {
|
|
29505
|
+
const items = [...arraySlice];
|
|
29506
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
|
|
29507
|
+
};
|
|
29508
|
+
const cloneShallowObjectSlice = objectSlice => {
|
|
29509
|
+
const items = [...objectSlice];
|
|
29510
|
+
return new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
|
|
29511
|
+
};
|
|
29512
|
+
|
|
29513
|
+
/* eslint-disable no-underscore-dangle */
|
|
29514
|
+
const cloneShallowElement = element => {
|
|
29515
|
+
// @ts-ignore
|
|
29516
|
+
const copy = new element.constructor();
|
|
29517
|
+
copy.element = element.element;
|
|
29518
|
+
if (element.meta.length > 0) {
|
|
29519
|
+
copy._meta = cloneDeep(element.meta);
|
|
29520
|
+
}
|
|
29521
|
+
if (element.attributes.length > 0) {
|
|
29522
|
+
copy._attributes = cloneDeep(element.attributes);
|
|
29523
|
+
}
|
|
29524
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(element.content)) {
|
|
29525
|
+
const content = element.content;
|
|
29526
|
+
copy.content = cloneShallowElement(content);
|
|
29527
|
+
} else if (Array.isArray(element.content)) {
|
|
29528
|
+
copy.content = [...element.content];
|
|
29529
|
+
} else if (element.content instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
29530
|
+
copy.content = cloneShallowKeyValuePair(element.content);
|
|
29531
|
+
} else {
|
|
29532
|
+
copy.content = element.content;
|
|
29533
|
+
}
|
|
29534
|
+
return copy;
|
|
29535
|
+
};
|
|
29536
|
+
/* eslint-enable */
|
|
29537
|
+
|
|
29538
|
+
const cloneShallow = value => {
|
|
29539
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
29540
|
+
return cloneShallowKeyValuePair(value);
|
|
29541
|
+
}
|
|
29542
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
|
|
29543
|
+
return cloneShallowObjectSlice(value);
|
|
29544
|
+
}
|
|
29545
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
29546
|
+
return cloneShallowArraySlice(value);
|
|
29547
|
+
}
|
|
29548
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(value)) {
|
|
29549
|
+
return cloneShallowElement(value);
|
|
29550
|
+
}
|
|
29551
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
29552
|
+
value
|
|
29553
|
+
});
|
|
29554
|
+
};
|
|
29555
|
+
cloneShallow.safe = value => {
|
|
29556
|
+
try {
|
|
29557
|
+
return cloneShallow(value);
|
|
29558
|
+
} catch {
|
|
29559
|
+
return value;
|
|
29560
|
+
}
|
|
29561
|
+
};
|
|
29562
|
+
|
|
29563
|
+
/***/ }),
|
|
29564
|
+
|
|
29402
29565
|
/***/ 12472:
|
|
29403
29566
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
29404
29567
|
|
|
@@ -29971,6 +30134,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29971
30134
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29972
30135
|
/* harmony export */ BREAK: () => (/* reexport safe */ _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__.BREAK),
|
|
29973
30136
|
/* harmony export */ PredicateVisitor: () => (/* binding */ PredicateVisitor),
|
|
30137
|
+
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
29974
30138
|
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
29975
30139
|
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
29976
30140
|
/* harmony export */ keyMapDefault: () => (/* binding */ keyMapDefault),
|
|
@@ -29979,9 +30143,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29979
30143
|
/* harmony export */ });
|
|
29980
30144
|
/* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
|
|
29981
30145
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13776);
|
|
29982
|
-
/* harmony import */ var
|
|
30146
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25992);
|
|
29983
30147
|
/* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51394);
|
|
29984
30148
|
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36903);
|
|
30149
|
+
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82434);
|
|
30150
|
+
|
|
29985
30151
|
|
|
29986
30152
|
|
|
29987
30153
|
|
|
@@ -30003,8 +30169,16 @@ const getNodeType = element => {
|
|
|
30003
30169
|
/* eslint-enable */
|
|
30004
30170
|
};
|
|
30005
30171
|
|
|
30172
|
+
// cloneNode :: a -> a
|
|
30173
|
+
const cloneNode = node => {
|
|
30174
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(node)) {
|
|
30175
|
+
return (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(node);
|
|
30176
|
+
}
|
|
30177
|
+
return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__.cloneNode)(node);
|
|
30178
|
+
};
|
|
30179
|
+
|
|
30006
30180
|
// isNode :: Node -> Boolean
|
|
30007
|
-
const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_1__.pipe)(getNodeType,
|
|
30181
|
+
const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_1__.pipe)(getNodeType, ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"]);
|
|
30008
30182
|
const keyMapDefault = {
|
|
30009
30183
|
ObjectElement: ['content'],
|
|
30010
30184
|
ArrayElement: ['content'],
|
|
@@ -30065,6 +30239,7 @@ visitor, {
|
|
|
30065
30239
|
// @ts-ignore
|
|
30066
30240
|
nodeTypeGetter: getNodeType,
|
|
30067
30241
|
nodePredicate: isNode,
|
|
30242
|
+
nodeCloneFn: cloneNode,
|
|
30068
30243
|
...rest
|
|
30069
30244
|
});
|
|
30070
30245
|
};
|
|
@@ -30083,6 +30258,7 @@ visitor, {
|
|
|
30083
30258
|
// @ts-ignore
|
|
30084
30259
|
nodeTypeGetter: getNodeType,
|
|
30085
30260
|
nodePredicate: isNode,
|
|
30261
|
+
nodeCloneFn: cloneNode,
|
|
30086
30262
|
...rest
|
|
30087
30263
|
});
|
|
30088
30264
|
};
|
|
@@ -30152,7 +30328,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30152
30328
|
class ApiDOMError extends Error {
|
|
30153
30329
|
static [Symbol.hasInstance](instance) {
|
|
30154
30330
|
// we want to ApiDOMAggregateError to act as if ApiDOMError was its superclass
|
|
30155
|
-
return
|
|
30331
|
+
return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(_ApiDOMAggregateError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"], instance);
|
|
30156
30332
|
}
|
|
30157
30333
|
constructor(message, options) {
|
|
30158
30334
|
super(message, options);
|
|
@@ -30185,6 +30361,30 @@ class ApiDOMError extends Error {
|
|
|
30185
30361
|
|
|
30186
30362
|
/***/ }),
|
|
30187
30363
|
|
|
30364
|
+
/***/ 69985:
|
|
30365
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
30366
|
+
|
|
30367
|
+
"use strict";
|
|
30368
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30369
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30370
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
30371
|
+
/* harmony export */ });
|
|
30372
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13776);
|
|
30373
|
+
/* harmony import */ var _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7471);
|
|
30374
|
+
|
|
30375
|
+
|
|
30376
|
+
class ApiDOMStructuredError extends _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
30377
|
+
constructor(message, structuredOptions) {
|
|
30378
|
+
super(message, structuredOptions);
|
|
30379
|
+
if (typeof structuredOptions !== 'undefined') {
|
|
30380
|
+
Object.assign(this, (0,ramda__WEBPACK_IMPORTED_MODULE_0__.omit)(['cause'], structuredOptions));
|
|
30381
|
+
}
|
|
30382
|
+
}
|
|
30383
|
+
}
|
|
30384
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiDOMStructuredError);
|
|
30385
|
+
|
|
30386
|
+
/***/ }),
|
|
30387
|
+
|
|
30188
30388
|
/***/ 61578:
|
|
30189
30389
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
30190
30390
|
|