@swagger-api/apidom-parser-adapter-openapi-json-3-1 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-json-3-1
|
|
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-json-3-1
|
|
@@ -37205,6 +37205,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
37205
37205
|
|
|
37206
37206
|
let parser = null;
|
|
37207
37207
|
let parserInitLock = null;
|
|
37208
|
+
let currentTree = null;
|
|
37209
|
+
|
|
37210
|
+
// clear the old Wasm-allocated tree & reset the parser state
|
|
37211
|
+
const releaseResources = () => {
|
|
37212
|
+
var _currentTree, _parser;
|
|
37213
|
+
(_currentTree = currentTree) === null || _currentTree === void 0 || _currentTree.delete();
|
|
37214
|
+
(_parser = parser) === null || _parser === void 0 || _parser.reset();
|
|
37215
|
+
};
|
|
37208
37216
|
|
|
37209
37217
|
/**
|
|
37210
37218
|
* Lexical Analysis of source string using WebTreeSitter.
|
|
@@ -37215,6 +37223,7 @@ let parserInitLock = null;
|
|
|
37215
37223
|
* @public
|
|
37216
37224
|
*/
|
|
37217
37225
|
const analyze = async source => {
|
|
37226
|
+
releaseResources();
|
|
37218
37227
|
if (parser === null && parserInitLock === null) {
|
|
37219
37228
|
// acquire lock
|
|
37220
37229
|
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 => {
|
|
@@ -37232,7 +37241,8 @@ const analyze = async source => {
|
|
|
37232
37241
|
} else if (parser === null) {
|
|
37233
37242
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_3__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-json grammar.');
|
|
37234
37243
|
}
|
|
37235
|
-
|
|
37244
|
+
currentTree = parser.parse(source);
|
|
37245
|
+
return currentTree;
|
|
37236
37246
|
};
|
|
37237
37247
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|
|
37238
37248
|
|