@swagger-api/apidom-parser-adapter-openapi-json-3-0 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-openapi-json-3-0
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-openapi-json-3-0
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-openapi-json-3-0
@@ -16112,8 +16112,20 @@ visitor, {
16112
16112
  for (const [stateKey, stateValue] of Object.entries(state)) {
16113
16113
  visitor[stateKey] = stateValue;
16114
16114
  }
16115
+ const link = {
16116
+ // eslint-disable-next-line @typescript-eslint/no-loop-func
16117
+ replaceWith(newNode, replacer) {
16118
+ if (typeof replacer === 'function') {
16119
+ replacer(newNode, node, key, parent, path, ancestors);
16120
+ } else if (parent) {
16121
+ parent[key] = newNode;
16122
+ }
16123
+ node = newNode;
16124
+ }
16125
+ };
16126
+
16115
16127
  // retrieve result
16116
- result = visitFn.call(visitor, node, key, parent, path, ancestors);
16128
+ result = visitFn.call(visitor, node, key, parent, path, ancestors, link);
16117
16129
  }
16118
16130
 
16119
16131
  // check if the visitor is async
@@ -16270,9 +16282,20 @@ visitor, {
16270
16282
  for (const [stateKey, stateValue] of Object.entries(state)) {
16271
16283
  visitor[stateKey] = stateValue;
16272
16284
  }
16285
+ const link = {
16286
+ // eslint-disable-next-line @typescript-eslint/no-loop-func
16287
+ replaceWith(newNode, replacer) {
16288
+ if (typeof replacer === 'function') {
16289
+ replacer(newNode, node, key, parent, path, ancestors);
16290
+ } else if (parent) {
16291
+ parent[key] = newNode;
16292
+ }
16293
+ node = newNode;
16294
+ }
16295
+ };
16273
16296
 
16274
16297
  // retrieve result
16275
- result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
16298
+ result = await visitFn.call(visitor, node, key, parent, path, ancestors, link); // eslint-disable-line no-await-in-loop
16276
16299
  }
16277
16300
  if (result === breakSymbol) {
16278
16301
  break;