@swagger-api/apidom-parser-adapter-openapi-yaml-2 1.0.0-alpha.1 → 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,10 @@
|
|
|
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-yaml-2
|
|
9
|
+
|
|
6
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)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
|
|
@@ -17449,8 +17449,20 @@ visitor, {
|
|
|
17449
17449
|
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
17450
17450
|
visitor[stateKey] = stateValue;
|
|
17451
17451
|
}
|
|
17452
|
+
const link = {
|
|
17453
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
17454
|
+
replaceWith(newNode, replacer) {
|
|
17455
|
+
if (typeof replacer === 'function') {
|
|
17456
|
+
replacer(newNode, node, key, parent, path, ancestors);
|
|
17457
|
+
} else if (parent) {
|
|
17458
|
+
parent[key] = newNode;
|
|
17459
|
+
}
|
|
17460
|
+
node = newNode;
|
|
17461
|
+
}
|
|
17462
|
+
};
|
|
17463
|
+
|
|
17452
17464
|
// retrieve result
|
|
17453
|
-
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
17465
|
+
result = visitFn.call(visitor, node, key, parent, path, ancestors, link);
|
|
17454
17466
|
}
|
|
17455
17467
|
|
|
17456
17468
|
// check if the visitor is async
|
|
@@ -17607,9 +17619,20 @@ visitor, {
|
|
|
17607
17619
|
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
17608
17620
|
visitor[stateKey] = stateValue;
|
|
17609
17621
|
}
|
|
17622
|
+
const link = {
|
|
17623
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
17624
|
+
replaceWith(newNode, replacer) {
|
|
17625
|
+
if (typeof replacer === 'function') {
|
|
17626
|
+
replacer(newNode, node, key, parent, path, ancestors);
|
|
17627
|
+
} else if (parent) {
|
|
17628
|
+
parent[key] = newNode;
|
|
17629
|
+
}
|
|
17630
|
+
node = newNode;
|
|
17631
|
+
}
|
|
17632
|
+
};
|
|
17610
17633
|
|
|
17611
17634
|
// retrieve result
|
|
17612
|
-
result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
|
|
17635
|
+
result = await visitFn.call(visitor, node, key, parent, path, ancestors, link); // eslint-disable-line no-await-in-loop
|
|
17613
17636
|
}
|
|
17614
17637
|
if (result === breakSymbol) {
|
|
17615
17638
|
break;
|