@swagger-api/apidom-parser-adapter-openapi-yaml-2 1.2.0 → 1.2.1

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.2.1](https://github.com/swagger-api/apidom/compare/v1.2.0...v1.2.1) (2026-01-16)
7
+
8
+ **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
9
+
6
10
  # [1.2.0](https://github.com/swagger-api/apidom/compare/v1.1.0...v1.2.0) (2026-01-14)
7
11
 
8
12
  **Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
@@ -23590,6 +23590,14 @@ __webpack_require__.r(__webpack_exports__);
23590
23590
 
23591
23591
  let parser = null;
23592
23592
  let parserInitLock = null;
23593
+ let currentTree = null;
23594
+
23595
+ // clear the old Wasm-allocated tree & reset the parser state
23596
+ const releaseResources = () => {
23597
+ var _currentTree, _parser;
23598
+ (_currentTree = currentTree) === null || _currentTree === void 0 || _currentTree.delete();
23599
+ (_parser = parser) === null || _parser === void 0 || _parser.reset();
23600
+ };
23593
23601
 
23594
23602
  /**
23595
23603
  * Lexical Analysis of source string using WebTreeSitter.
@@ -23600,6 +23608,7 @@ let parserInitLock = null;
23600
23608
  * @public
23601
23609
  */
23602
23610
  const analyze = async source => {
23611
+ releaseResources();
23603
23612
  if (parser === null && parserInitLock === null) {
23604
23613
  // acquire lock
23605
23614
  parserInitLock = web_tree_sitter__WEBPACK_IMPORTED_MODULE_1__.init().then(() => web_tree_sitter__WEBPACK_IMPORTED_MODULE_1__.Language.load(_wasm_tree_sitter_yaml_wasm__WEBPACK_IMPORTED_MODULE_2__["default"])).then(jsonLanguage => {
@@ -23617,7 +23626,8 @@ const analyze = async source => {
23617
23626
  } else if (parser === null) {
23618
23627
  throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_3__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-yaml grammar.');
23619
23628
  }
23620
- return parser.parse(source);
23629
+ currentTree = parser.parse(source);
23630
+ return currentTree;
23621
23631
  };
23622
23632
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
23623
23633