@swagger-api/apidom-parser-adapter-asyncapi-json-2 1.0.0-alpha.0 → 1.0.0-alpha.2

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
+ # [1.0.0-alpha.2](https://github.com/swagger-api/apidom/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2024-05-20)
7
+
8
+ **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
9
+
10
+ # [1.0.0-alpha.1](https://github.com/swagger-api/apidom/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2024-05-15)
11
+
12
+ **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
13
+
6
14
  # [1.0.0-alpha.0](https://github.com/swagger-api/apidom/compare/v0.99.2...v1.0.0-alpha.0) (2024-05-14)
7
15
 
8
16
  **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-asyncapi-json-2
@@ -16194,8 +16194,20 @@ visitor, {
16194
16194
  for (const [stateKey, stateValue] of Object.entries(state)) {
16195
16195
  visitor[stateKey] = stateValue;
16196
16196
  }
16197
+ const link = {
16198
+ // eslint-disable-next-line @typescript-eslint/no-loop-func
16199
+ replaceWith(newNode, replacer) {
16200
+ if (typeof replacer === 'function') {
16201
+ replacer(newNode, node, key, parent, path, ancestors);
16202
+ } else if (parent) {
16203
+ parent[key] = newNode;
16204
+ }
16205
+ node = newNode;
16206
+ }
16207
+ };
16208
+
16197
16209
  // retrieve result
16198
- result = visitFn.call(visitor, node, key, parent, path, ancestors);
16210
+ result = visitFn.call(visitor, node, key, parent, path, ancestors, link);
16199
16211
  }
16200
16212
 
16201
16213
  // check if the visitor is async
@@ -16352,9 +16364,20 @@ visitor, {
16352
16364
  for (const [stateKey, stateValue] of Object.entries(state)) {
16353
16365
  visitor[stateKey] = stateValue;
16354
16366
  }
16367
+ const link = {
16368
+ // eslint-disable-next-line @typescript-eslint/no-loop-func
16369
+ replaceWith(newNode, replacer) {
16370
+ if (typeof replacer === 'function') {
16371
+ replacer(newNode, node, key, parent, path, ancestors);
16372
+ } else if (parent) {
16373
+ parent[key] = newNode;
16374
+ }
16375
+ node = newNode;
16376
+ }
16377
+ };
16355
16378
 
16356
16379
  // retrieve result
16357
- result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
16380
+ result = await visitFn.call(visitor, node, key, parent, path, ancestors, link); // eslint-disable-line no-await-in-loop
16358
16381
  }
16359
16382
  if (result === breakSymbol) {
16360
16383
  break;