@swagger-api/apidom-parser-adapter-arazzo-yaml-1 1.9.0 → 1.10.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,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.10.0](https://github.com/swagger-api/apidom/compare/v1.9.0...v1.10.0) (2026-04-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-arazzo-yaml-1
|
|
9
|
+
|
|
6
10
|
# [1.9.0](https://github.com/swagger-api/apidom/compare/v1.8.0...v1.9.0) (2026-03-30)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-arazzo-yaml-1
|
|
@@ -19681,7 +19681,8 @@
|
|
|
19681
19681
|
|
|
19682
19682
|
let parser = null;
|
|
19683
19683
|
let parserInitLock = null;
|
|
19684
|
-
|
|
19684
|
+
const activeTrees = new Set();
|
|
19685
|
+
const MAX_ACTIVE_TREES = 5;
|
|
19685
19686
|
const createAnalyze = treeSitterYaml => async source => {
|
|
19686
19687
|
if (parser === null && parserInitLock === null) {
|
|
19687
19688
|
// acquire lock
|
|
@@ -19701,12 +19702,28 @@
|
|
|
19701
19702
|
if (parser === null) {
|
|
19702
19703
|
throw new ApiDOMError('Error while initializing web-tree-sitter and loading tree-sitter-yaml grammar.');
|
|
19703
19704
|
}
|
|
19704
|
-
|
|
19705
|
-
|
|
19705
|
+
|
|
19706
|
+
// prevent WASM OOM during concurrency spikes by evicting oldest trees
|
|
19707
|
+
// when the pool exceeds threshold; tree.delete() is idempotent so
|
|
19708
|
+
// callers that still hold a reference can safely call delete() again
|
|
19709
|
+
if (activeTrees.size >= MAX_ACTIVE_TREES) {
|
|
19710
|
+
const treesToEvict = [...activeTrees];
|
|
19711
|
+
activeTrees.clear();
|
|
19712
|
+
for (const oldTree of treesToEvict) {
|
|
19713
|
+
oldTree.delete();
|
|
19714
|
+
}
|
|
19706
19715
|
}
|
|
19707
|
-
|
|
19716
|
+
const tree = parser.parse(source);
|
|
19717
|
+
activeTrees.add(tree);
|
|
19718
|
+
|
|
19719
|
+
// remove from tracking when caller deletes
|
|
19720
|
+
const originalDelete = tree.delete;
|
|
19721
|
+
tree.delete = function deleteAndUntrack() {
|
|
19722
|
+
activeTrees.delete(this);
|
|
19723
|
+
originalDelete.call(this);
|
|
19724
|
+
};
|
|
19708
19725
|
parser.reset();
|
|
19709
|
-
return
|
|
19726
|
+
return tree;
|
|
19710
19727
|
};
|
|
19711
19728
|
|
|
19712
19729
|
/**
|
|
@@ -20567,13 +20584,16 @@
|
|
|
20567
20584
|
* @public
|
|
20568
20585
|
*/
|
|
20569
20586
|
const detect$1 = async source => {
|
|
20587
|
+
let cst = null;
|
|
20570
20588
|
try {
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
cst.delete();
|
|
20574
|
-
return isError;
|
|
20589
|
+
cst = await analyze$1(source);
|
|
20590
|
+
return !cst.rootNode.isError;
|
|
20575
20591
|
} catch {
|
|
20576
20592
|
return false;
|
|
20593
|
+
} finally {
|
|
20594
|
+
if (cst !== null) {
|
|
20595
|
+
cst.delete();
|
|
20596
|
+
}
|
|
20577
20597
|
}
|
|
20578
20598
|
};
|
|
20579
20599
|
|
|
@@ -20591,12 +20611,17 @@
|
|
|
20591
20611
|
const parse$1 = async (source, {
|
|
20592
20612
|
sourceMap = false
|
|
20593
20613
|
} = {}) => {
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
|
|
20597
|
-
|
|
20598
|
-
|
|
20599
|
-
|
|
20614
|
+
let cst = null;
|
|
20615
|
+
try {
|
|
20616
|
+
cst = await analyze$1(source);
|
|
20617
|
+
return analyze(cst, {
|
|
20618
|
+
sourceMap
|
|
20619
|
+
});
|
|
20620
|
+
} finally {
|
|
20621
|
+
if (cst !== null) {
|
|
20622
|
+
cst.delete();
|
|
20623
|
+
}
|
|
20624
|
+
}
|
|
20600
20625
|
};
|
|
20601
20626
|
|
|
20602
20627
|
/**
|