@speclynx/apidom-parser-adapter-openapi-yaml-2 6.1.0 → 6.1.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,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
|
+
## [6.1.2](https://github.com/speclynx/apidom/compare/v6.1.1...v6.1.2) (2026-10-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-yaml-2
|
|
9
|
+
|
|
10
|
+
## [6.1.1](https://github.com/speclynx/apidom/compare/v6.1.0...v6.1.1) (2026-10-29)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- serialize empty YAML mapping keys to the empty string ([#709](https://github.com/speclynx/apidom/issues/709)) ([3ecce30](https://github.com/speclynx/apidom/commit/3ecce3025b89e5bcdb1481525fe35a86685285f9)), closes [#655](https://github.com/speclynx/apidom/issues/655) [#694](https://github.com/speclynx/apidom/issues/694)
|
|
15
|
+
|
|
6
16
|
# [6.1.0](https://github.com/speclynx/apidom/compare/v6.0.6...v6.1.0) (2026-10-17)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-yaml-2
|
|
@@ -30531,11 +30531,8 @@ const resolveSpecification = specification => {
|
|
|
30531
30531
|
__webpack_require__.r(__webpack_exports__);
|
|
30532
30532
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
30533
30533
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96911);
|
|
30534
|
-
/* harmony import */ var
|
|
30535
|
-
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10977);
|
|
30534
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10977);
|
|
30536
30535
|
|
|
30537
|
-
// an empty YAML node (YAML 1.2 §7.2) is a null parsed as an empty string with the yaml-e-node class
|
|
30538
|
-
const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) && element.toValue() === '' && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses)(element, ['yaml-e-node']);
|
|
30539
30536
|
|
|
30540
30537
|
/**
|
|
30541
30538
|
* Transforms the ApiDOM into JavaScript POJO.
|
|
@@ -30545,7 +30542,6 @@ const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_M
|
|
|
30545
30542
|
*/
|
|
30546
30543
|
const serializer = element => {
|
|
30547
30544
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) return element;
|
|
30548
|
-
if (isEmptyNode(element)) return null;
|
|
30549
30545
|
|
|
30550
30546
|
// Shortcut optimization for primitive element types
|
|
30551
30547
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNumberElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isBooleanElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNullElement)(element)) {
|
|
@@ -30563,8 +30559,8 @@ const serializer = element => {
|
|
|
30563
30559
|
node.forEach((value, key) => {
|
|
30564
30560
|
const k = serialize(key);
|
|
30565
30561
|
const v = serialize(value);
|
|
30566
|
-
const name = (0,
|
|
30567
|
-
if (name !== undefined) (0,
|
|
30562
|
+
const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__.toPropertyName)(k);
|
|
30563
|
+
if (name !== undefined) (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, name, v);
|
|
30568
30564
|
});
|
|
30569
30565
|
return obj;
|
|
30570
30566
|
}
|
|
@@ -30579,7 +30575,6 @@ const serializer = element => {
|
|
|
30579
30575
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isLinkElement)(node)) {
|
|
30580
30576
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(node.href) ? node.href.toValue() : '';
|
|
30581
30577
|
}
|
|
30582
|
-
if (isEmptyNode(node)) return null;
|
|
30583
30578
|
return node.toValue();
|
|
30584
30579
|
};
|
|
30585
30580
|
return serialize(element);
|
|
@@ -32607,11 +32602,10 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
32607
32602
|
|
|
32608
32603
|
"use strict";
|
|
32609
32604
|
__webpack_require__.r(__webpack_exports__);
|
|
32610
|
-
/* empty/unused harmony star reexport */
|
|
32611
32605
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
32612
32606
|
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
32613
|
-
/* harmony import */ var
|
|
32614
|
-
/* harmony import */ var
|
|
32607
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
32608
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
32615
32609
|
|
|
32616
32610
|
|
|
32617
32611
|
|
|
@@ -32781,13 +32775,13 @@ class Element {
|
|
|
32781
32775
|
}
|
|
32782
32776
|
|
|
32783
32777
|
// KeyValuePair
|
|
32784
|
-
if (value instanceof
|
|
32778
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
32785
32779
|
this._content = value;
|
|
32786
32780
|
return;
|
|
32787
32781
|
}
|
|
32788
32782
|
|
|
32789
32783
|
// ObjectSlice - extract elements array
|
|
32790
|
-
if (value instanceof
|
|
32784
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
32791
32785
|
this._content = value.elements;
|
|
32792
32786
|
return;
|
|
32793
32787
|
}
|
|
@@ -32906,7 +32900,7 @@ class Element {
|
|
|
32906
32900
|
if (Array.isArray(content)) {
|
|
32907
32901
|
return content;
|
|
32908
32902
|
}
|
|
32909
|
-
if (content instanceof
|
|
32903
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
32910
32904
|
const children = [];
|
|
32911
32905
|
if (content.key) children.push(content.key);
|
|
32912
32906
|
if (content.value) children.push(content.value);
|
|
@@ -32970,7 +32964,7 @@ class Element {
|
|
|
32970
32964
|
if (_content instanceof Element) {
|
|
32971
32965
|
return _content.toValue();
|
|
32972
32966
|
}
|
|
32973
|
-
if (_content instanceof
|
|
32967
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
32974
32968
|
return _content.toValue();
|
|
32975
32969
|
}
|
|
32976
32970
|
if (Array.isArray(_content)) {
|
|
@@ -41425,25 +41419,24 @@ class AllOfVisitor extends JSONSchemaAllOfVisitor {
|
|
|
41425
41419
|
|
|
41426
41420
|
"use strict";
|
|
41427
41421
|
__webpack_require__.r(__webpack_exports__);
|
|
41428
|
-
/*
|
|
41429
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
41430
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26207);
|
|
41422
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86059);
|
|
41423
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26207);
|
|
41431
41424
|
|
|
41432
41425
|
|
|
41433
41426
|
|
|
41434
41427
|
/**
|
|
41435
41428
|
* @public
|
|
41436
41429
|
*/
|
|
41437
|
-
class ItemsVisitor extends
|
|
41430
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
41438
41431
|
ObjectElement(path) {
|
|
41439
|
-
|
|
41440
|
-
if ((0,
|
|
41432
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ObjectElement.call(this, path);
|
|
41433
|
+
if ((0,_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)(this.element)) {
|
|
41441
41434
|
this.element.meta.set('referenced-element', 'schema');
|
|
41442
41435
|
}
|
|
41443
41436
|
}
|
|
41444
41437
|
ArrayElement(path) {
|
|
41445
|
-
|
|
41446
|
-
this.element.filter(
|
|
41438
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ArrayElement.call(this, path);
|
|
41439
|
+
this.element.filter(_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)
|
|
41447
41440
|
// @ts-ignore
|
|
41448
41441
|
.forEach(referenceElement => {
|
|
41449
41442
|
referenceElement.meta.set('referenced-element', 'schema');
|
|
@@ -41741,9 +41734,6 @@ class XmlVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixedFields
|
|
|
41741
41734
|
|
|
41742
41735
|
"use strict";
|
|
41743
41736
|
__webpack_require__.r(__webpack_exports__);
|
|
41744
|
-
/* empty/unused harmony star reexport */
|
|
41745
|
-
/* empty/unused harmony star reexport */
|
|
41746
|
-
/* empty/unused harmony star reexport */
|
|
41747
41737
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
41748
41738
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
41749
41739
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
@@ -41818,10 +41808,8 @@ const parse = async (source, {
|
|
|
41818
41808
|
|
|
41819
41809
|
"use strict";
|
|
41820
41810
|
__webpack_require__.r(__webpack_exports__);
|
|
41821
|
-
/*
|
|
41822
|
-
/*
|
|
41823
|
-
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47657);
|
|
41824
|
-
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67919);
|
|
41811
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47657);
|
|
41812
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67919);
|
|
41825
41813
|
|
|
41826
41814
|
|
|
41827
41815
|
|
|
@@ -41832,7 +41820,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41832
41820
|
const detect = async source => {
|
|
41833
41821
|
let cst = null;
|
|
41834
41822
|
try {
|
|
41835
|
-
cst = await (0,
|
|
41823
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
41836
41824
|
return !cst.rootNode.isError;
|
|
41837
41825
|
} catch {
|
|
41838
41826
|
return false;
|
|
@@ -41852,9 +41840,9 @@ const parse = async (source, {
|
|
|
41852
41840
|
sourceMap = false,
|
|
41853
41841
|
style = false
|
|
41854
41842
|
} = {}) => {
|
|
41855
|
-
const cst = await (0,
|
|
41843
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
41856
41844
|
try {
|
|
41857
|
-
return (0,
|
|
41845
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
41858
41846
|
sourceMap,
|
|
41859
41847
|
style
|
|
41860
41848
|
});
|
|
@@ -42760,15 +42748,19 @@ const transformCstToYamlAst = (cursor, ctx) => {
|
|
|
42760
42748
|
__webpack_require__.r(__webpack_exports__);
|
|
42761
42749
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
42762
42750
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
42763
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
42764
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
42765
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
42766
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
42767
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
42768
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
42769
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
42770
|
-
/* harmony import */ var
|
|
42771
|
-
/* harmony import */ var
|
|
42751
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55297);
|
|
42752
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28121);
|
|
42753
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18252);
|
|
42754
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97601);
|
|
42755
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31770);
|
|
42756
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97071);
|
|
42757
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84660);
|
|
42758
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40094);
|
|
42759
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4823);
|
|
42760
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(25810);
|
|
42761
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49686);
|
|
42762
|
+
/* harmony import */ var _ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90594);
|
|
42763
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21544);
|
|
42772
42764
|
|
|
42773
42765
|
|
|
42774
42766
|
// Transform context passed through transformation
|
|
@@ -42778,7 +42770,7 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
42778
42770
|
if (!ctx.sourceMap) {
|
|
42779
42771
|
return;
|
|
42780
42772
|
}
|
|
42781
|
-
|
|
42773
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(node, element);
|
|
42782
42774
|
};
|
|
42783
42775
|
|
|
42784
42776
|
// find the first descendant matching a type path through the AST
|
|
@@ -42796,7 +42788,7 @@ const findFirst = (node, path) => {
|
|
|
42796
42788
|
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
42797
42789
|
const detectIndent = node => {
|
|
42798
42790
|
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
42799
|
-
if (nested?.styleGroup ===
|
|
42791
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
42800
42792
|
return nested.startCharacter;
|
|
42801
42793
|
}
|
|
42802
42794
|
return 2;
|
|
@@ -42928,7 +42920,7 @@ const buildYamlStyle = (node, ctx, extras) => {
|
|
|
42928
42920
|
// an untagged node has the non-specific tag '?' when it's a plain scalar and '!' otherwise
|
|
42929
42921
|
// (YAML 1.2 §6.9.1); an explicit '!' on any other node means the same as no tag
|
|
42930
42922
|
const tag = node.tag?.explicitName;
|
|
42931
|
-
if (tag !== undefined && tag !== (node.style ===
|
|
42923
|
+
if (tag !== undefined && tag !== (node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain ? '?' : '!')) {
|
|
42932
42924
|
yamlStyle.tag = tag;
|
|
42933
42925
|
}
|
|
42934
42926
|
// the anchor's name, without the & indicator
|
|
@@ -43042,17 +43034,17 @@ const collectStreamComments = node => {
|
|
|
43042
43034
|
if (!root) comments.before.push(text);else if (comment.startLine === root.endLine) comments.inline.push(text);else comments.after.push(text);
|
|
43043
43035
|
};
|
|
43044
43036
|
for (const child of node.children) {
|
|
43045
|
-
if ((0,
|
|
43037
|
+
if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isDocument)(child)) {
|
|
43046
43038
|
if (root) break;
|
|
43047
43039
|
// comments after an explicit document start (---) or before an explicit document end (...)
|
|
43048
43040
|
// are the document's own children, around its root node
|
|
43049
43041
|
const children = child.children || [];
|
|
43050
|
-
const rootIndex = children.findIndex(c => !(0,
|
|
43042
|
+
const rootIndex = children.findIndex(c => !(0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(c));
|
|
43051
43043
|
if (rootIndex === -1) break;
|
|
43052
|
-
children.slice(0, rootIndex).filter(
|
|
43044
|
+
children.slice(0, rootIndex).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
43053
43045
|
root = children[rootIndex];
|
|
43054
|
-
children.slice(rootIndex + 1).filter(
|
|
43055
|
-
} else if ((0,
|
|
43046
|
+
children.slice(rootIndex + 1).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
43047
|
+
} else if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(child)) {
|
|
43056
43048
|
collect(child);
|
|
43057
43049
|
}
|
|
43058
43050
|
}
|
|
@@ -43065,7 +43057,7 @@ const transformStream = (node, ctx) => {
|
|
|
43065
43057
|
if (ctx.style) {
|
|
43066
43058
|
ctx.indent = detectIndent(node);
|
|
43067
43059
|
}
|
|
43068
|
-
const element = new
|
|
43060
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
43069
43061
|
|
|
43070
43062
|
// Transform all children
|
|
43071
43063
|
const children = transformChildren(node.children || [], ctx);
|
|
@@ -43125,7 +43117,7 @@ const transformDocument = (node, ctx) => {
|
|
|
43125
43117
|
const shouldSkipVisitingMoreDocuments = ctx.processedDocumentCount >= 1;
|
|
43126
43118
|
if (shouldWarnAboutMoreDocuments) {
|
|
43127
43119
|
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
43128
|
-
const element = new
|
|
43120
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
43129
43121
|
element.classes.push('warning');
|
|
43130
43122
|
maybeAddSourceMap(node, element, ctx);
|
|
43131
43123
|
ctx.annotations.push(element);
|
|
@@ -43144,7 +43136,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
43144
43136
|
const typedNode = node;
|
|
43145
43137
|
const children = node.children || [];
|
|
43146
43138
|
if (ctx.style) {
|
|
43147
|
-
if (ctx.flowCollectionPadding === null && node.styleGroup ===
|
|
43139
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Flow) {
|
|
43148
43140
|
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
43149
43141
|
}
|
|
43150
43142
|
const comments = collectComments(children, typedNode.startCharacter);
|
|
@@ -43155,7 +43147,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
43155
43147
|
element.style = buildYamlStyle(node, ctx, {
|
|
43156
43148
|
comment: comments.trailing,
|
|
43157
43149
|
// a single pair written directly in a flow sequence (e.g. [a: 1])
|
|
43158
|
-
singlePair: node.style ===
|
|
43150
|
+
singlePair: node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.SinglePair || undefined
|
|
43159
43151
|
});
|
|
43160
43152
|
if (comments.outOfScope.length > 0) {
|
|
43161
43153
|
ctx.promotedComments.push(...comments.outOfScope);
|
|
@@ -43168,14 +43160,14 @@ const transformCollection = (element, node, ctx) => {
|
|
|
43168
43160
|
|
|
43169
43161
|
// Mapping: Transforms to ObjectElement
|
|
43170
43162
|
const transformMapping = (node, ctx) => {
|
|
43171
|
-
const element = new
|
|
43163
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
43172
43164
|
transformCollection(element, node, ctx);
|
|
43173
43165
|
return element;
|
|
43174
43166
|
};
|
|
43175
43167
|
|
|
43176
43168
|
// KeyValuePair: Transforms to MemberElement
|
|
43177
43169
|
const transformKeyValuePair = (node, ctx) => {
|
|
43178
|
-
const element = new
|
|
43170
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
43179
43171
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43180
43172
|
const {
|
|
43181
43173
|
key,
|
|
@@ -43186,15 +43178,25 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
43186
43178
|
styleGroup,
|
|
43187
43179
|
startCharacter
|
|
43188
43180
|
} = value;
|
|
43189
|
-
if (styleGroup ===
|
|
43181
|
+
if (styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block) {
|
|
43190
43182
|
ctx.indentSeq = startCharacter > node.startCharacter;
|
|
43191
43183
|
}
|
|
43192
43184
|
}
|
|
43193
43185
|
|
|
43194
43186
|
// Transform key and value (these are dynamically defined properties)
|
|
43195
|
-
|
|
43187
|
+
let keyResult = transform(key, ctx);
|
|
43196
43188
|
const valueResult = transform(value, ctx);
|
|
43197
43189
|
|
|
43190
|
+
// an empty key is a null in YAML, but a JavaScript property name can't be null, so it's the empty
|
|
43191
|
+
// string it's named by, marked as an empty key
|
|
43192
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(keyResult) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(keyResult, ['yaml-e-node'])) {
|
|
43193
|
+
const emptyKey = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]('', keyResult.meta, keyResult.attributes);
|
|
43194
|
+
emptyKey.classes.push('yaml-e-key');
|
|
43195
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(keyResult, emptyKey);
|
|
43196
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__["default"].transfer(keyResult, emptyKey);
|
|
43197
|
+
keyResult = emptyKey;
|
|
43198
|
+
}
|
|
43199
|
+
|
|
43198
43200
|
// @ts-ignore
|
|
43199
43201
|
element.content.key = keyResult;
|
|
43200
43202
|
// @ts-ignore
|
|
@@ -43214,19 +43216,18 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
43214
43216
|
|
|
43215
43217
|
// Sequence: Transforms to ArrayElement
|
|
43216
43218
|
const transformSequence = (node, ctx) => {
|
|
43217
|
-
const element = new
|
|
43219
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
43218
43220
|
transformCollection(element, node, ctx);
|
|
43219
43221
|
return element;
|
|
43220
43222
|
};
|
|
43221
43223
|
|
|
43222
43224
|
// Scalar: Converts to Element via namespace
|
|
43223
43225
|
const transformScalar = (node, ctx) => {
|
|
43224
|
-
|
|
43225
|
-
|
|
43226
|
-
// Translate style information about empty nodes; an empty node (YAML 1.2 §7.2) is a null unless
|
|
43227
|
-
// a tag other than the null tag makes it something else (e.g. !!str makes it an empty string)
|
|
43226
|
+
// an empty node (YAML 1.2 §7.2) is a null unless a tag other than the null tag makes it
|
|
43227
|
+
// something else (e.g. !!str makes it an empty string); its classes tell it from an explicit null
|
|
43228
43228
|
const tag = node.tag?.explicitName;
|
|
43229
|
-
const isEmptyNode = node.content === '' && node.style ===
|
|
43229
|
+
const isEmptyNode = node.content === '' && node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain && [undefined, '?', '!!null', '!<tag:yaml.org,2002:null>'].includes(tag);
|
|
43230
|
+
const element = isEmptyNode ? new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]() : ctx.namespace.toElement(node.content);
|
|
43230
43231
|
if (isEmptyNode) {
|
|
43231
43232
|
element.classes.push('yaml-e-node');
|
|
43232
43233
|
element.classes.push('yaml-e-scalar');
|
|
@@ -43254,7 +43255,7 @@ const transformComment = (node, ctx) => {
|
|
|
43254
43255
|
// Only interested in stream comments before the first document
|
|
43255
43256
|
if (isStreamComment) {
|
|
43256
43257
|
// @ts-ignore
|
|
43257
|
-
const element = new
|
|
43258
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__["default"](node.content);
|
|
43258
43259
|
maybeAddSourceMap(node, element, ctx);
|
|
43259
43260
|
return element;
|
|
43260
43261
|
}
|
|
@@ -43265,7 +43266,7 @@ const transformComment = (node, ctx) => {
|
|
|
43265
43266
|
const transformLiteral = (node, ctx) => {
|
|
43266
43267
|
if (node.isMissing) {
|
|
43267
43268
|
const message = `(Missing ${node.value})`;
|
|
43268
|
-
const element = new
|
|
43269
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
43269
43270
|
element.classes.push('warning');
|
|
43270
43271
|
maybeAddSourceMap(node, element, ctx);
|
|
43271
43272
|
ctx.annotations.push(element);
|
|
@@ -43276,7 +43277,7 @@ const transformLiteral = (node, ctx) => {
|
|
|
43276
43277
|
// Error as annotation (used by keyValuePair)
|
|
43277
43278
|
const transformErrorAsAnnotation = (node, ctx) => {
|
|
43278
43279
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
43279
|
-
const element = new
|
|
43280
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
43280
43281
|
element.classes.push('error');
|
|
43281
43282
|
maybeAddSourceMap(node, element, ctx);
|
|
43282
43283
|
ctx.annotations.push(element);
|
|
@@ -43285,7 +43286,7 @@ const transformErrorAsAnnotation = (node, ctx) => {
|
|
|
43285
43286
|
// Error: Creates error annotation (adds to annotations array)
|
|
43286
43287
|
const transformError = (node, ctx) => {
|
|
43287
43288
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
43288
|
-
const element = new
|
|
43289
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
43289
43290
|
element.classes.push('error');
|
|
43290
43291
|
maybeAddSourceMap(node, element, ctx);
|
|
43291
43292
|
ctx.annotations.push(element);
|
|
@@ -43295,10 +43296,10 @@ const transformError = (node, ctx) => {
|
|
|
43295
43296
|
// Error at root level: Creates ParseResultElement with error annotation
|
|
43296
43297
|
const transformRootError = (node, ctx) => {
|
|
43297
43298
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
43298
|
-
const element = new
|
|
43299
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
43299
43300
|
element.classes.push('error');
|
|
43300
43301
|
maybeAddSourceMap(node, element, ctx);
|
|
43301
|
-
const parseResultElement = new
|
|
43302
|
+
const parseResultElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
43302
43303
|
parseResultElement.push(element);
|
|
43303
43304
|
return parseResultElement;
|
|
43304
43305
|
};
|
|
@@ -43325,7 +43326,7 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
43325
43326
|
|
|
43326
43327
|
// Handle empty parse result
|
|
43327
43328
|
if (!rootNode) {
|
|
43328
|
-
return new
|
|
43329
|
+
return new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
43329
43330
|
}
|
|
43330
43331
|
|
|
43331
43332
|
// Handle root-level error (no valid stream, just an error node)
|
|
@@ -43335,12 +43336,12 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
43335
43336
|
const result = transform(rootNode, ctx);
|
|
43336
43337
|
|
|
43337
43338
|
// Result should be a ParseResultElement from transformStream
|
|
43338
|
-
if (result instanceof
|
|
43339
|
+
if (result instanceof _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]) {
|
|
43339
43340
|
return result;
|
|
43340
43341
|
}
|
|
43341
43342
|
|
|
43342
43343
|
// Fallback: wrap in ParseResultElement
|
|
43343
|
-
const parseResult = new
|
|
43344
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
43344
43345
|
if (result !== null) {
|
|
43345
43346
|
if (Array.isArray(result)) {
|
|
43346
43347
|
result.forEach(el => parseResult.push(el));
|