@swagger-api/apidom-parser-adapter-asyncapi-json-2 0.79.0 → 0.81.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 CHANGED
@@ -3,6 +3,14 @@
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
+ # [0.81.0](https://github.com/swagger-api/apidom/compare/v0.80.0...v0.81.0) (2023-10-30)
7
+
8
+ **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
9
+
10
+ # [0.80.0](https://github.com/swagger-api/apidom/compare/v0.79.0...v0.80.0) (2023-10-26)
11
+
12
+ **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
13
+
6
14
  # [0.79.0](https://github.com/swagger-api/apidom/compare/v0.78.0...v0.79.0) (2023-10-24)
7
15
 
8
16
  **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
@@ -15986,7 +15986,7 @@ __webpack_require__.r(__webpack_exports__);
15986
15986
  /* harmony export */ mergeAll: () => (/* binding */ mergeAll),
15987
15987
  /* harmony export */ visit: () => (/* binding */ visit)
15988
15988
  /* harmony export */ });
15989
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7471);
15989
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69985);
15990
15990
 
15991
15991
 
15992
15992
  /**
@@ -16257,7 +16257,9 @@ visitor, {
16257
16257
  let result;
16258
16258
  if (!Array.isArray(node)) {
16259
16259
  if (!nodePredicate(node)) {
16260
- throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
16260
+ throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${String(node)}`, {
16261
+ node
16262
+ });
16261
16263
  }
16262
16264
 
16263
16265
  // cycle detected; skipping over a sub-tree to avoid recursion
@@ -16406,7 +16408,9 @@ visitor, {
16406
16408
  let result;
16407
16409
  if (!Array.isArray(node)) {
16408
16410
  if (!nodePredicate(node)) {
16409
- throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
16411
+ throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${String(node)}`, {
16412
+ node
16413
+ });
16410
16414
  }
16411
16415
 
16412
16416
  // cycle detected; skipping over a sub-tree to avoid recursion
@@ -16488,7 +16492,14 @@ __webpack_require__.r(__webpack_exports__);
16488
16492
  /* harmony export */ });
16489
16493
  /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69985);
16490
16494
 
16491
- class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {}
16495
+ class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {
16496
+ constructor(message, structuredOptions) {
16497
+ super(message, structuredOptions);
16498
+ if (typeof structuredOptions !== 'undefined') {
16499
+ this.value = structuredOptions.source;
16500
+ }
16501
+ }
16502
+ }
16492
16503
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CloneError);
16493
16504
 
16494
16505
  /***/ }),
@@ -16533,32 +16544,72 @@ __webpack_require__.r(__webpack_exports__);
16533
16544
  /* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
16534
16545
  /* harmony export */ });
16535
16546
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67952);
16536
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36903);
16537
- /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34646);
16547
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36903);
16548
+ /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34646);
16538
16549
  /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10219);
16539
16550
 
16540
16551
 
16541
16552
 
16542
16553
 
16543
- const invokeClone = value => {
16544
- if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
16545
- return value.clone();
16554
+ const cloneDeep = (value, options = {}) => {
16555
+ const {
16556
+ visited = new WeakMap()
16557
+ } = options;
16558
+ const passThroughOptions = {
16559
+ ...options,
16560
+ visited
16561
+ };
16562
+
16563
+ // detect cycle and return memoized value
16564
+ if (visited.has(value)) {
16565
+ return visited.get(value);
16566
+ }
16567
+ if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
16568
+ const {
16569
+ key,
16570
+ value: val
16571
+ } = value;
16572
+ const keyCopy = (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(key) ? cloneDeep(key, passThroughOptions) : key;
16573
+ const valueCopy = (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(val) ? cloneDeep(val, passThroughOptions) : val;
16574
+ const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair(keyCopy, valueCopy);
16575
+ visited.set(value, copy);
16576
+ return copy;
16546
16577
  }
16547
- return value;
16548
- };
16549
- const cloneDeep = value => {
16550
16578
  if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
16551
- const items = [...value].map(invokeClone);
16552
- return new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
16579
+ const mapper = element => cloneDeep(element, passThroughOptions);
16580
+ const items = [...value].map(mapper);
16581
+ const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
16582
+ visited.set(value, copy);
16583
+ return copy;
16553
16584
  }
16554
16585
  if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
16555
- const items = [...value].map(invokeClone);
16556
- return new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
16586
+ const mapper = element => cloneDeep(element, passThroughOptions);
16587
+ const items = [...value].map(mapper);
16588
+ const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
16589
+ visited.set(value, copy);
16590
+ return copy;
16557
16591
  }
16558
- if (typeof (value === null || value === void 0 ? void 0 : value.clone) === 'function') {
16559
- return value.clone();
16592
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value)) {
16593
+ const copy = cloneShallow(value); // eslint-disable-line @typescript-eslint/no-use-before-define
16594
+
16595
+ visited.set(value, copy);
16596
+ if (value.content) {
16597
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value.content)) {
16598
+ copy.content = cloneDeep(value.content, passThroughOptions);
16599
+ } else if (value.content instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
16600
+ copy.content = cloneDeep(value.content, passThroughOptions);
16601
+ } else if (Array.isArray(value.content)) {
16602
+ const mapper = element => cloneDeep(element, passThroughOptions);
16603
+ copy.content = value.content.map(mapper);
16604
+ } else {
16605
+ copy.content = value.content;
16606
+ }
16607
+ } else {
16608
+ copy.content = value.content;
16609
+ }
16610
+ return copy;
16560
16611
  }
16561
- throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]("Value provided to cloneDeep function couldn't be cloned", {
16612
+ throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]("Value provided to cloneDeep function couldn't be cloned", {
16562
16613
  value
16563
16614
  });
16564
16615
  };
@@ -16596,7 +16647,7 @@ const cloneShallowElement = element => {
16596
16647
  if (element.attributes.length > 0) {
16597
16648
  copy._attributes = cloneDeep(element.attributes);
16598
16649
  }
16599
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(element.content)) {
16650
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(element.content)) {
16600
16651
  const content = element.content;
16601
16652
  copy.content = cloneShallowElement(content);
16602
16653
  } else if (Array.isArray(element.content)) {
@@ -16620,7 +16671,7 @@ const cloneShallow = value => {
16620
16671
  if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
16621
16672
  return cloneShallowArraySlice(value);
16622
16673
  }
16623
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(value)) {
16674
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value)) {
16624
16675
  return cloneShallowElement(value);
16625
16676
  }
16626
16677
  throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]("Value provided to cloneShallow function couldn't be cloned", {