@swagger-api/apidom-parser-adapter-openapi-json-3-0 1.2.1 → 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,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.2](https://github.com/swagger-api/apidom/compare/v1.2.1...v1.2.2) (2026-01-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-json-3-0
|
|
9
|
+
|
|
6
10
|
## [1.2.1](https://github.com/swagger-api/apidom/compare/v1.2.0...v1.2.1) (2026-01-16)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-json-3-0
|
|
@@ -3326,7 +3326,9 @@ const detect = async source => {
|
|
|
3326
3326
|
}
|
|
3327
3327
|
try {
|
|
3328
3328
|
const cst = await (0,_lexical_analysis_browser_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(source);
|
|
3329
|
-
|
|
3329
|
+
const isError = cst.rootNode.type !== 'ERROR';
|
|
3330
|
+
cst.delete();
|
|
3331
|
+
return isError;
|
|
3330
3332
|
} catch {
|
|
3331
3333
|
return false;
|
|
3332
3334
|
}
|
|
@@ -3358,6 +3360,7 @@ const parse = async (source, {
|
|
|
3358
3360
|
sourceMap
|
|
3359
3361
|
});
|
|
3360
3362
|
}
|
|
3363
|
+
cst.delete();
|
|
3361
3364
|
return apiDOM;
|
|
3362
3365
|
};
|
|
3363
3366
|
|
|
@@ -28785,13 +28788,6 @@ let parser = null;
|
|
|
28785
28788
|
let parserInitLock = null;
|
|
28786
28789
|
let currentTree = null;
|
|
28787
28790
|
|
|
28788
|
-
// clear the old Wasm-allocated tree & reset the parser state
|
|
28789
|
-
const releaseResources = () => {
|
|
28790
|
-
var _currentTree, _parser;
|
|
28791
|
-
(_currentTree = currentTree) === null || _currentTree === void 0 || _currentTree.delete();
|
|
28792
|
-
(_parser = parser) === null || _parser === void 0 || _parser.reset();
|
|
28793
|
-
};
|
|
28794
|
-
|
|
28795
28791
|
/**
|
|
28796
28792
|
* Lexical Analysis of source string using WebTreeSitter.
|
|
28797
28793
|
* This is WebAssembly version of TreeSitters Lexical Analysis.
|
|
@@ -28801,7 +28797,6 @@ const releaseResources = () => {
|
|
|
28801
28797
|
* @public
|
|
28802
28798
|
*/
|
|
28803
28799
|
const analyze = async source => {
|
|
28804
|
-
releaseResources();
|
|
28805
28800
|
if (parser === null && parserInitLock === null) {
|
|
28806
28801
|
// acquire lock
|
|
28807
28802
|
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 => {
|
|
@@ -28820,6 +28815,7 @@ const analyze = async source => {
|
|
|
28820
28815
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_3__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-json grammar.');
|
|
28821
28816
|
}
|
|
28822
28817
|
currentTree = parser.parse(source);
|
|
28818
|
+
parser.reset();
|
|
28823
28819
|
return currentTree;
|
|
28824
28820
|
};
|
|
28825
28821
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|