@swagger-api/apidom-parser-adapter-asyncapi-json-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-asyncapi-json-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-asyncapi-json-2
|
|
@@ -36531,6 +36531,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
36531
36531
|
|
|
36532
36532
|
let parser = null;
|
|
36533
36533
|
let parserInitLock = null;
|
|
36534
|
+
let currentTree = null;
|
|
36535
|
+
|
|
36536
|
+
// clear the old Wasm-allocated tree & reset the parser state
|
|
36537
|
+
const releaseResources = () => {
|
|
36538
|
+
var _currentTree, _parser;
|
|
36539
|
+
(_currentTree = currentTree) === null || _currentTree === void 0 || _currentTree.delete();
|
|
36540
|
+
(_parser = parser) === null || _parser === void 0 || _parser.reset();
|
|
36541
|
+
};
|
|
36534
36542
|
|
|
36535
36543
|
/**
|
|
36536
36544
|
* Lexical Analysis of source string using WebTreeSitter.
|
|
@@ -36541,6 +36549,7 @@ let parserInitLock = null;
|
|
|
36541
36549
|
* @public
|
|
36542
36550
|
*/
|
|
36543
36551
|
const analyze = async source => {
|
|
36552
|
+
releaseResources();
|
|
36544
36553
|
if (parser === null && parserInitLock === null) {
|
|
36545
36554
|
// acquire lock
|
|
36546
36555
|
parserInitLock = web_tree_sitter__WEBPACK_IMPORTED_MODULE_1__.init().then(() => web_tree_sitter__WEBPACK_IMPORTED_MODULE_1__.Language.load(_wasm_tree_sitter_json_wasm__WEBPACK_IMPORTED_MODULE_2__["default"])).then(jsonLanguage => {
|
|
@@ -36558,7 +36567,8 @@ const analyze = async source => {
|
|
|
36558
36567
|
} else if (parser === null) {
|
|
36559
36568
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_3__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-json grammar.');
|
|
36560
36569
|
}
|
|
36561
|
-
|
|
36570
|
+
currentTree = parser.parse(source);
|
|
36571
|
+
return currentTree;
|
|
36562
36572
|
};
|
|
36563
36573
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|
|
36564
36574
|
|