@swagger-api/apidom-parser-adapter-json-schema-json-2020-12 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-json-schema-json-2020-12
|
|
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-json-schema-json-2020-12
|
|
@@ -3139,7 +3139,9 @@ const detect = async source => {
|
|
|
3139
3139
|
}
|
|
3140
3140
|
try {
|
|
3141
3141
|
const cst = await (0,_lexical_analysis_browser_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(source);
|
|
3142
|
-
|
|
3142
|
+
const isError = cst.rootNode.type !== 'ERROR';
|
|
3143
|
+
cst.delete();
|
|
3144
|
+
return isError;
|
|
3143
3145
|
} catch {
|
|
3144
3146
|
return false;
|
|
3145
3147
|
}
|
|
@@ -3171,6 +3173,7 @@ const parse = async (source, {
|
|
|
3171
3173
|
sourceMap
|
|
3172
3174
|
});
|
|
3173
3175
|
}
|
|
3176
|
+
cst.delete();
|
|
3174
3177
|
return apiDOM;
|
|
3175
3178
|
};
|
|
3176
3179
|
|
|
@@ -24362,13 +24365,6 @@ let parser = null;
|
|
|
24362
24365
|
let parserInitLock = null;
|
|
24363
24366
|
let currentTree = null;
|
|
24364
24367
|
|
|
24365
|
-
// clear the old Wasm-allocated tree & reset the parser state
|
|
24366
|
-
const releaseResources = () => {
|
|
24367
|
-
var _currentTree, _parser;
|
|
24368
|
-
(_currentTree = currentTree) === null || _currentTree === void 0 || _currentTree.delete();
|
|
24369
|
-
(_parser = parser) === null || _parser === void 0 || _parser.reset();
|
|
24370
|
-
};
|
|
24371
|
-
|
|
24372
24368
|
/**
|
|
24373
24369
|
* Lexical Analysis of source string using WebTreeSitter.
|
|
24374
24370
|
* This is WebAssembly version of TreeSitters Lexical Analysis.
|
|
@@ -24378,7 +24374,6 @@ const releaseResources = () => {
|
|
|
24378
24374
|
* @public
|
|
24379
24375
|
*/
|
|
24380
24376
|
const analyze = async source => {
|
|
24381
|
-
releaseResources();
|
|
24382
24377
|
if (parser === null && parserInitLock === null) {
|
|
24383
24378
|
// acquire lock
|
|
24384
24379
|
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 => {
|
|
@@ -24397,6 +24392,7 @@ const analyze = async source => {
|
|
|
24397
24392
|
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_3__["default"]('Error while initializing web-tree-sitter and loading tree-sitter-json grammar.');
|
|
24398
24393
|
}
|
|
24399
24394
|
currentTree = parser.parse(source);
|
|
24395
|
+
parser.reset();
|
|
24400
24396
|
return currentTree;
|
|
24401
24397
|
};
|
|
24402
24398
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|