@swagger-api/apidom-parser-adapter-yaml-1-2 1.2.0 → 1.2.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,18 @@
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.2](https://github.com/swagger-api/apidom/compare/v1.2.1...v1.2.2) (2026-01-16)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **parser:** fix tree being deleted before analysis completion ([#5099](https://github.com/swagger-api/apidom/issues/5099)) ([5bf6eaf](https://github.com/swagger-api/apidom/commit/5bf6eaf99d04eccef8a4c563afe03e206a3c0df7))
11
+
12
+ ## [1.2.1](https://github.com/swagger-api/apidom/compare/v1.2.0...v1.2.1) (2026-01-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **parser:** clear the old Wasm-allocated tree to prevent memory leaks ([#5097](https://github.com/swagger-api/apidom/issues/5097)) ([fd160a7](https://github.com/swagger-api/apidom/commit/fd160a7453c15bc160c04a1325aecd845f6d4882))
17
+
6
18
  # [1.2.0](https://github.com/swagger-api/apidom/compare/v1.1.0...v1.2.0) (2026-01-14)
7
19
 
8
20
  ### Bug Fixes
@@ -4073,6 +4073,7 @@ __webpack_require__.r(__webpack_exports__);
4073
4073
 
4074
4074
  let parser = null;
4075
4075
  let parserInitLock = null;
4076
+ let currentTree = null;
4076
4077
 
4077
4078
  /**
4078
4079
  * Lexical Analysis of source string using WebTreeSitter.
@@ -4100,7 +4101,9 @@ const analyze = async source => {
4100
4101
  } else if (parser === null) {
4101
4102
  throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_2__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-yaml grammar.');
4102
4103
  }
4103
- return parser.parse(source);
4104
+ currentTree = parser.parse(source);
4105
+ parser.reset();
4106
+ return currentTree;
4104
4107
  };
4105
4108
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
4106
4109
 
@@ -22904,7 +22907,9 @@ __webpack_require__.r(__webpack_exports__);
22904
22907
  const detect = async source => {
22905
22908
  try {
22906
22909
  const cst = await (0,_lexical_analysis_browser_ts__WEBPACK_IMPORTED_MODULE_2__["default"])(source);
22907
- return !cst.rootNode.isError;
22910
+ const isError = !cst.rootNode.isError;
22911
+ cst.delete();
22912
+ return isError;
22908
22913
  } catch {
22909
22914
  return false;
22910
22915
  }
@@ -22925,9 +22930,11 @@ const parse = async (source, {
22925
22930
  sourceMap = false
22926
22931
  } = {}) => {
22927
22932
  const cst = await (0,_lexical_analysis_browser_ts__WEBPACK_IMPORTED_MODULE_2__["default"])(source);
22928
- return (0,_syntactic_analysis_indirect_index_ts__WEBPACK_IMPORTED_MODULE_3__["default"])(cst, {
22933
+ const syntacticAnalysisResult = (0,_syntactic_analysis_indirect_index_ts__WEBPACK_IMPORTED_MODULE_3__["default"])(cst, {
22929
22934
  sourceMap
22930
22935
  });
22936
+ cst.delete();
22937
+ return syntacticAnalysisResult;
22931
22938
  };
22932
22939
  })();
22933
22940