@swagger-api/apidom-parser-adapter-openapi-yaml-2 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-openapi-yaml-2
|
|
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-openapi-yaml-2
|
|
@@ -19485,7 +19485,8 @@
|
|
|
19485
19485
|
|
|
19486
19486
|
let parser = null;
|
|
19487
19487
|
let parserInitLock = null;
|
|
19488
|
-
|
|
19488
|
+
const activeTrees = new Set();
|
|
19489
|
+
const MAX_ACTIVE_TREES = 5;
|
|
19489
19490
|
const createAnalyze = treeSitterYaml => async source => {
|
|
19490
19491
|
if (parser === null && parserInitLock === null) {
|
|
19491
19492
|
// acquire lock
|
|
@@ -19505,12 +19506,28 @@
|
|
|
19505
19506
|
if (parser === null) {
|
|
19506
19507
|
throw new ApiDOMError('Error while initializing web-tree-sitter and loading tree-sitter-yaml grammar.');
|
|
19507
19508
|
}
|
|
19508
|
-
|
|
19509
|
-
|
|
19509
|
+
|
|
19510
|
+
// prevent WASM OOM during concurrency spikes by evicting oldest trees
|
|
19511
|
+
// when the pool exceeds threshold; tree.delete() is idempotent so
|
|
19512
|
+
// callers that still hold a reference can safely call delete() again
|
|
19513
|
+
if (activeTrees.size >= MAX_ACTIVE_TREES) {
|
|
19514
|
+
const treesToEvict = [...activeTrees];
|
|
19515
|
+
activeTrees.clear();
|
|
19516
|
+
for (const oldTree of treesToEvict) {
|
|
19517
|
+
oldTree.delete();
|
|
19518
|
+
}
|
|
19510
19519
|
}
|
|
19511
|
-
|
|
19520
|
+
const tree = parser.parse(source);
|
|
19521
|
+
activeTrees.add(tree);
|
|
19522
|
+
|
|
19523
|
+
// remove from tracking when caller deletes
|
|
19524
|
+
const originalDelete = tree.delete;
|
|
19525
|
+
tree.delete = function deleteAndUntrack() {
|
|
19526
|
+
activeTrees.delete(this);
|
|
19527
|
+
originalDelete.call(this);
|
|
19528
|
+
};
|
|
19512
19529
|
parser.reset();
|
|
19513
|
-
return
|
|
19530
|
+
return tree;
|
|
19514
19531
|
};
|
|
19515
19532
|
|
|
19516
19533
|
/**
|
|
@@ -20371,13 +20388,16 @@
|
|
|
20371
20388
|
* @public
|
|
20372
20389
|
*/
|
|
20373
20390
|
const detect$1 = async source => {
|
|
20391
|
+
let cst = null;
|
|
20374
20392
|
try {
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
cst.delete();
|
|
20378
|
-
return isError;
|
|
20393
|
+
cst = await analyze$1(source);
|
|
20394
|
+
return !cst.rootNode.isError;
|
|
20379
20395
|
} catch {
|
|
20380
20396
|
return false;
|
|
20397
|
+
} finally {
|
|
20398
|
+
if (cst !== null) {
|
|
20399
|
+
cst.delete();
|
|
20400
|
+
}
|
|
20381
20401
|
}
|
|
20382
20402
|
};
|
|
20383
20403
|
|
|
@@ -20395,12 +20415,17 @@
|
|
|
20395
20415
|
const parse$1 = async (source, {
|
|
20396
20416
|
sourceMap = false
|
|
20397
20417
|
} = {}) => {
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
|
|
20401
|
-
|
|
20402
|
-
|
|
20403
|
-
|
|
20418
|
+
let cst = null;
|
|
20419
|
+
try {
|
|
20420
|
+
cst = await analyze$1(source);
|
|
20421
|
+
return analyze(cst, {
|
|
20422
|
+
sourceMap
|
|
20423
|
+
});
|
|
20424
|
+
} finally {
|
|
20425
|
+
if (cst !== null) {
|
|
20426
|
+
cst.delete();
|
|
20427
|
+
}
|
|
20428
|
+
}
|
|
20404
20429
|
};
|
|
20405
20430
|
|
|
20406
20431
|
/**
|