@speclynx/apidom-parser-adapter-json-schema-yaml-2020-12 2.2.3 → 2.4.0

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,16 @@
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
+ # [2.4.0](https://github.com/speclynx/apidom/compare/v2.3.0...v2.4.0) (2026-01-29)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-json-schema-yaml-2020-12
9
+
10
+ # [2.3.0](https://github.com/speclynx/apidom/compare/v2.2.3...v2.3.0) (2026-01-27)
11
+
12
+ ### Features
13
+
14
+ - support strict parsing mode through out the packages ([#46](https://github.com/speclynx/apidom/issues/46)) ([e6b47d9](https://github.com/speclynx/apidom/commit/e6b47d9cfdede7103cada67362b316fd8e5b787f)), closes [#23](https://github.com/speclynx/apidom/issues/23)
15
+
6
16
  ## [2.2.3](https://github.com/speclynx/apidom/compare/v2.2.2...v2.2.3) (2026-01-26)
7
17
 
8
18
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-json-schema-yaml-2020-12
@@ -4036,7 +4036,7 @@ __webpack_require__.r(__webpack_exports__);
4036
4036
  /* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
4037
4037
  /* harmony export */ });
4038
4038
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5156);
4039
- /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6126);
4039
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(746);
4040
4040
  /* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9124);
4041
4041
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(405);
4042
4042
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7657);
@@ -4076,10 +4076,6 @@ const detect = async (source, {
4076
4076
  * @public
4077
4077
  */
4078
4078
 
4079
- /**
4080
- * @public
4081
- */
4082
-
4083
4079
  /**
4084
4080
  * @public
4085
4081
  */
@@ -39092,7 +39088,8 @@ __webpack_require__.r(__webpack_exports__);
39092
39088
  /* harmony export */ });
39093
39089
  /* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3291);
39094
39090
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(404);
39095
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4823);
39091
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4660);
39092
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
39096
39093
 
39097
39094
 
39098
39095
 
@@ -39100,9 +39097,15 @@ __webpack_require__.r(__webpack_exports__);
39100
39097
  * @public
39101
39098
  */
39102
39099
  const detect = async source => {
39100
+ if (source.trim().length === 0) {
39101
+ return false;
39102
+ }
39103
39103
  try {
39104
- (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
39105
- return true;
39104
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
39105
+ version: '1.2'
39106
+ });
39107
+ // Filter out MULTIPLE_DOCS errors (handled as warning in parse)
39108
+ return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
39106
39109
  } catch {
39107
39110
  return false;
39108
39111
  }
@@ -39112,9 +39115,28 @@ const detect = async source => {
39112
39115
  * @public
39113
39116
  */
39114
39117
  const parse = async source => {
39115
- const pojo = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
39116
- const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(pojo);
39117
- const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
39118
+ const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
39119
+ if (source.trim().length === 0) {
39120
+ return parseResult;
39121
+ }
39122
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
39123
+ version: '1.2'
39124
+ });
39125
+
39126
+ // Handle document errors
39127
+ for (const error of document.errors) {
39128
+ if (error.code === 'MULTIPLE_DOCS') {
39129
+ // Multiple documents warning (align with tree-sitter behavior)
39130
+ const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
39131
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
39132
+ annotation.classes.push('warning');
39133
+ parseResult.push(annotation);
39134
+ } else {
39135
+ // Fatal error - throw
39136
+ throw error;
39137
+ }
39138
+ }
39139
+ const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
39118
39140
  element.classes.push('result');
39119
39141
  parseResult.push(element);
39120
39142
  return parseResult;
@@ -41705,7 +41727,11 @@ const detectionRegExp = /(?<YAML>^(["']?)\$schema\2\s*:\s*(["']?)https:\/\/json-
41705
41727
  /**
41706
41728
  * @public
41707
41729
  */
41708
- const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
41730
+ const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
41731
+
41732
+ /**
41733
+ * @public
41734
+ */
41709
41735
 
41710
41736
  /**
41711
41737
  * @public