cdk8s 2.7.61 → 2.7.63
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/.jsii +3 -3
- package/lib/api-object.js +1 -1
- package/lib/app.js +1 -1
- package/lib/chart.js +1 -1
- package/lib/cron.js +1 -1
- package/lib/dependency.js +2 -2
- package/lib/duration.js +1 -1
- package/lib/helm.js +1 -1
- package/lib/include.js +1 -1
- package/lib/json-patch.js +1 -1
- package/lib/lazy.js +1 -1
- package/lib/metadata.js +1 -1
- package/lib/names.js +1 -1
- package/lib/size.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/yaml.js +6 -4
- package/node_modules/yaml/README.md +2 -2
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +1 -1
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +4 -3
- package/node_modules/yaml/browser/dist/compose/compose-node.js +18 -5
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +19 -13
- package/node_modules/yaml/browser/dist/compose/composer.js +8 -10
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +30 -13
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +12 -3
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +10 -5
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +17 -6
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +8 -2
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +9 -1
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +1 -1
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +76 -19
- package/node_modules/yaml/browser/dist/doc/anchors.js +2 -2
- package/node_modules/yaml/browser/dist/doc/createNode.js +14 -11
- package/node_modules/yaml/browser/dist/doc/directives.js +11 -3
- package/node_modules/yaml/browser/dist/errors.js +1 -1
- package/node_modules/yaml/browser/dist/index.js +1 -2
- package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +30 -16
- package/node_modules/yaml/browser/dist/nodes/Node.js +7 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +11 -3
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +1 -1
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +10 -10
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +5 -13
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +3 -2
- package/node_modules/yaml/browser/dist/nodes/toJS.js +3 -1
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +3 -8
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +2 -2
- package/node_modules/yaml/browser/dist/parse/lexer.js +49 -22
- package/node_modules/yaml/browser/dist/parse/parser.js +142 -68
- package/node_modules/yaml/browser/dist/public-api.js +5 -7
- package/node_modules/yaml/browser/dist/schema/Schema.js +19 -4
- package/node_modules/yaml/browser/dist/schema/common/null.js +3 -1
- package/node_modules/yaml/browser/dist/schema/core/float.js +4 -1
- package/node_modules/yaml/browser/dist/schema/tags.js +17 -13
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +4 -1
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +1 -1
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +6 -1
- package/node_modules/yaml/browser/dist/stringify/stringify.js +53 -23
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +114 -85
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -12
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +36 -15
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +71 -32
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +56 -53
- package/node_modules/yaml/browser/dist/util.js +3 -0
- package/node_modules/yaml/browser/dist/visit.js +149 -62
- package/node_modules/yaml/dist/compose/compose-collection.js +1 -1
- package/node_modules/yaml/dist/compose/compose-doc.js +4 -3
- package/node_modules/yaml/dist/compose/compose-node.d.ts +4 -2
- package/node_modules/yaml/dist/compose/compose-node.js +18 -5
- package/node_modules/yaml/dist/compose/compose-scalar.js +18 -12
- package/node_modules/yaml/dist/compose/composer.d.ts +3 -3
- package/node_modules/yaml/dist/compose/composer.js +10 -12
- package/node_modules/yaml/dist/compose/resolve-block-map.js +30 -13
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +12 -3
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +10 -5
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +17 -6
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +8 -2
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -1
- package/node_modules/yaml/dist/compose/resolve-props.js +9 -1
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +1 -1
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +24 -15
- package/node_modules/yaml/dist/doc/Document.js +80 -23
- package/node_modules/yaml/dist/doc/anchors.d.ts +3 -3
- package/node_modules/yaml/dist/doc/anchors.js +2 -2
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +1 -1
- package/node_modules/yaml/dist/doc/createNode.d.ts +3 -2
- package/node_modules/yaml/dist/doc/createNode.js +13 -10
- package/node_modules/yaml/dist/doc/directives.d.ts +5 -2
- package/node_modules/yaml/dist/doc/directives.js +11 -3
- package/node_modules/yaml/dist/errors.d.ts +2 -2
- package/node_modules/yaml/dist/errors.js +1 -1
- package/node_modules/yaml/dist/index.d.ts +6 -4
- package/node_modules/yaml/dist/index.js +1 -2
- package/node_modules/yaml/dist/log.d.ts +1 -1
- package/node_modules/yaml/dist/nodes/Alias.d.ts +8 -4
- package/node_modules/yaml/dist/nodes/Collection.d.ts +12 -6
- package/node_modules/yaml/dist/nodes/Collection.js +29 -15
- package/node_modules/yaml/dist/nodes/Node.d.ts +22 -11
- package/node_modules/yaml/dist/nodes/Node.js +7 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +8 -3
- package/node_modules/yaml/dist/nodes/Pair.js +10 -2
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +2 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +1 -1
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +12 -4
- package/node_modules/yaml/dist/nodes/YAMLMap.js +10 -10
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +6 -1
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +5 -13
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +2 -1
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +2 -1
- package/node_modules/yaml/dist/nodes/toJS.js +3 -1
- package/node_modules/yaml/dist/options.d.ts +82 -22
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +6 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +3 -8
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
- package/node_modules/yaml/dist/parse/cst-visit.js +2 -2
- package/node_modules/yaml/dist/parse/cst.d.ts +3 -3
- package/node_modules/yaml/dist/parse/lexer.d.ts +2 -0
- package/node_modules/yaml/dist/parse/lexer.js +49 -22
- package/node_modules/yaml/dist/parse/parser.js +142 -68
- package/node_modules/yaml/dist/public-api.js +5 -7
- package/node_modules/yaml/dist/schema/Schema.d.ts +9 -7
- package/node_modules/yaml/dist/schema/Schema.js +18 -3
- package/node_modules/yaml/dist/schema/common/null.js +3 -1
- package/node_modules/yaml/dist/schema/core/float.js +4 -1
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +3 -4
- package/node_modules/yaml/dist/schema/tags.js +17 -13
- package/node_modules/yaml/dist/schema/types.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +4 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +7 -3
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +6 -2
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +6 -1
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +1 -1
- package/node_modules/yaml/dist/stringify/stringify.d.ts +7 -4
- package/node_modules/yaml/dist/stringify/stringify.js +53 -23
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -6
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +113 -84
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -2
- package/node_modules/yaml/dist/stringify/stringifyComment.js +19 -12
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +35 -14
- package/node_modules/yaml/dist/stringify/stringifyPair.js +70 -31
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +7 -1
- package/node_modules/yaml/dist/stringify/stringifyString.js +56 -53
- package/node_modules/yaml/dist/test-events.d.ts +1 -1
- package/node_modules/yaml/dist/test-events.js +14 -14
- package/node_modules/yaml/dist/util.d.ts +3 -0
- package/node_modules/yaml/dist/util.js +6 -0
- package/node_modules/yaml/dist/visit.d.ts +51 -12
- package/node_modules/yaml/dist/visit.js +148 -60
- package/node_modules/yaml/package.json +19 -17
- package/node_modules/yaml/util.d.ts +3 -0
- package/package.json +4 -4
- package/node_modules/yaml/browser/dist/options.js +0 -17
- package/node_modules/yaml/dist/options.js +0 -19
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isCollection, isNode, isScalar, isSeq } from '../nodes/Node.js';
|
|
2
2
|
import { Scalar } from '../nodes/Scalar.js';
|
|
3
3
|
import { stringify } from './stringify.js';
|
|
4
|
-
import {
|
|
4
|
+
import { lineComment, indentComment } from './stringifyComment.js';
|
|
5
5
|
|
|
6
6
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
7
|
-
const { allNullValues, doc, indent, indentStep, options: { indentSeq, simpleKeys } } = ctx;
|
|
7
|
+
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
8
8
|
let keyComment = (isNode(key) && key.comment) || null;
|
|
9
9
|
if (simpleKeys) {
|
|
10
10
|
if (keyComment) {
|
|
@@ -39,32 +39,42 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
39
39
|
if (allNullValues || value == null) {
|
|
40
40
|
if (keyCommentDone && onComment)
|
|
41
41
|
onComment();
|
|
42
|
-
return explicitKey ? `? ${str}` : str;
|
|
42
|
+
return str === '' ? '?' : explicitKey ? `? ${str}` : str;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
str = `? ${str}`;
|
|
47
|
+
if (keyComment && !keyCommentDone) {
|
|
48
|
+
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
49
|
+
}
|
|
50
|
+
else if (chompKeep && onChompKeep)
|
|
49
51
|
onChompKeep();
|
|
50
|
-
return
|
|
52
|
+
return str;
|
|
51
53
|
}
|
|
52
54
|
if (keyCommentDone)
|
|
53
55
|
keyComment = null;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (explicitKey) {
|
|
57
|
+
if (keyComment)
|
|
58
|
+
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
59
|
+
str = `? ${str}\n${indent}:`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
str = `${str}:`;
|
|
63
|
+
if (keyComment)
|
|
64
|
+
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
65
|
+
}
|
|
66
|
+
let vsb, vcb, valueComment;
|
|
59
67
|
if (isNode(value)) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (value.commentBefore)
|
|
63
|
-
vcb += `\n${stringifyComment(value.commentBefore, ctx.indent)}`;
|
|
68
|
+
vsb = !!value.spaceBefore;
|
|
69
|
+
vcb = value.commentBefore;
|
|
64
70
|
valueComment = value.comment;
|
|
65
71
|
}
|
|
66
|
-
else
|
|
67
|
-
|
|
72
|
+
else {
|
|
73
|
+
vsb = false;
|
|
74
|
+
vcb = null;
|
|
75
|
+
valueComment = null;
|
|
76
|
+
if (value && typeof value === 'object')
|
|
77
|
+
value = doc.createNode(value);
|
|
68
78
|
}
|
|
69
79
|
ctx.implicitKey = false;
|
|
70
80
|
if (!explicitKey && !keyComment && isScalar(value))
|
|
@@ -79,33 +89,62 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
79
89
|
!value.tag &&
|
|
80
90
|
!value.anchor) {
|
|
81
91
|
// If indentSeq === false, consider '- ' as part of indentation where possible
|
|
82
|
-
ctx.indent = ctx.indent.
|
|
92
|
+
ctx.indent = ctx.indent.substring(2);
|
|
83
93
|
}
|
|
84
94
|
let valueCommentDone = false;
|
|
85
95
|
const valueStr = stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
|
|
86
96
|
let ws = ' ';
|
|
87
|
-
if (
|
|
88
|
-
ws =
|
|
97
|
+
if (keyComment || vsb || vcb) {
|
|
98
|
+
ws = vsb ? '\n' : '';
|
|
99
|
+
if (vcb) {
|
|
100
|
+
const cs = commentString(vcb);
|
|
101
|
+
ws += `\n${indentComment(cs, ctx.indent)}`;
|
|
102
|
+
}
|
|
103
|
+
if (valueStr === '' && !ctx.inFlow) {
|
|
104
|
+
if (ws === '\n')
|
|
105
|
+
ws = '\n\n';
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
ws += `\n${ctx.indent}`;
|
|
109
|
+
}
|
|
89
110
|
}
|
|
90
111
|
else if (!explicitKey && isCollection(value)) {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
112
|
+
const vs0 = valueStr[0];
|
|
113
|
+
const nl0 = valueStr.indexOf('\n');
|
|
114
|
+
const hasNewline = nl0 !== -1;
|
|
115
|
+
const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
|
|
116
|
+
if (hasNewline || !flow) {
|
|
117
|
+
let hasPropsLine = false;
|
|
118
|
+
if (hasNewline && (vs0 === '&' || vs0 === '!')) {
|
|
119
|
+
let sp0 = valueStr.indexOf(' ');
|
|
120
|
+
if (vs0 === '&' &&
|
|
121
|
+
sp0 !== -1 &&
|
|
122
|
+
sp0 < nl0 &&
|
|
123
|
+
valueStr[sp0 + 1] === '!') {
|
|
124
|
+
sp0 = valueStr.indexOf(' ', sp0 + 1);
|
|
125
|
+
}
|
|
126
|
+
if (sp0 === -1 || nl0 < sp0)
|
|
127
|
+
hasPropsLine = true;
|
|
128
|
+
}
|
|
129
|
+
if (!hasPropsLine)
|
|
130
|
+
ws = `\n${ctx.indent}`;
|
|
131
|
+
}
|
|
94
132
|
}
|
|
95
|
-
else if (valueStr[0] === '\n')
|
|
133
|
+
else if (valueStr === '' || valueStr[0] === '\n') {
|
|
96
134
|
ws = '';
|
|
135
|
+
}
|
|
136
|
+
str += ws + valueStr;
|
|
97
137
|
if (ctx.inFlow) {
|
|
98
138
|
if (valueCommentDone && onComment)
|
|
99
139
|
onComment();
|
|
100
|
-
return str + ws + valueStr;
|
|
101
140
|
}
|
|
102
|
-
else {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return addComment(str + ws + valueStr, ctx.indent, valueComment);
|
|
141
|
+
else if (valueComment && !valueCommentDone) {
|
|
142
|
+
str += lineComment(str, ctx.indent, commentString(valueComment));
|
|
143
|
+
}
|
|
144
|
+
else if (chompKeep && onChompKeep) {
|
|
145
|
+
onChompKeep();
|
|
108
146
|
}
|
|
147
|
+
return str;
|
|
109
148
|
}
|
|
110
149
|
|
|
111
150
|
export { stringifyPair };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Scalar } from '../nodes/Scalar.js';
|
|
2
2
|
import { foldFlowLines, FOLD_QUOTED, FOLD_FLOW, FOLD_BLOCK } from './foldFlowLines.js';
|
|
3
3
|
|
|
4
|
-
const getFoldOptions = (ctx) => ({
|
|
5
|
-
indentAtStart: ctx.indentAtStart,
|
|
4
|
+
const getFoldOptions = (ctx, isBlock) => ({
|
|
5
|
+
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
6
6
|
lineWidth: ctx.options.lineWidth,
|
|
7
7
|
minContentWidth: ctx.options.minContentWidth
|
|
8
8
|
});
|
|
@@ -115,37 +115,53 @@ function doubleQuotedString(value, ctx) {
|
|
|
115
115
|
str = start ? str + json.slice(start) : json;
|
|
116
116
|
return implicitKey
|
|
117
117
|
? str
|
|
118
|
-
: foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx));
|
|
118
|
+
: foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
119
119
|
}
|
|
120
120
|
function singleQuotedString(value, ctx) {
|
|
121
|
-
if (ctx.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// single quoted string can't have leading or trailing whitespace around newline
|
|
127
|
-
if (/[ \t]\n|\n[ \t]/.test(value))
|
|
128
|
-
return doubleQuotedString(value, ctx);
|
|
129
|
-
}
|
|
121
|
+
if (ctx.options.singleQuote === false ||
|
|
122
|
+
(ctx.implicitKey && value.includes('\n')) ||
|
|
123
|
+
/[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
|
|
124
|
+
)
|
|
125
|
+
return doubleQuotedString(value, ctx);
|
|
130
126
|
const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
|
|
131
127
|
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
|
132
128
|
return ctx.implicitKey
|
|
133
129
|
? res
|
|
134
|
-
: foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx));
|
|
130
|
+
: foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
131
|
+
}
|
|
132
|
+
function quotedString(value, ctx) {
|
|
133
|
+
const { singleQuote } = ctx.options;
|
|
134
|
+
let qs;
|
|
135
|
+
if (singleQuote === false)
|
|
136
|
+
qs = doubleQuotedString;
|
|
137
|
+
else {
|
|
138
|
+
const hasDouble = value.includes('"');
|
|
139
|
+
const hasSingle = value.includes("'");
|
|
140
|
+
if (hasDouble && !hasSingle)
|
|
141
|
+
qs = singleQuotedString;
|
|
142
|
+
else if (hasSingle && !hasDouble)
|
|
143
|
+
qs = doubleQuotedString;
|
|
144
|
+
else
|
|
145
|
+
qs = singleQuote ? singleQuotedString : doubleQuotedString;
|
|
146
|
+
}
|
|
147
|
+
return qs(value, ctx);
|
|
135
148
|
}
|
|
136
149
|
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
150
|
+
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
137
151
|
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
138
152
|
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
139
|
-
if (/\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
140
|
-
return
|
|
153
|
+
if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
154
|
+
return quotedString(value, ctx);
|
|
141
155
|
}
|
|
142
156
|
const indent = ctx.indent ||
|
|
143
157
|
(ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');
|
|
144
|
-
const literal =
|
|
145
|
-
?
|
|
146
|
-
: type === Scalar.
|
|
147
|
-
?
|
|
148
|
-
:
|
|
158
|
+
const literal = blockQuote === 'literal'
|
|
159
|
+
? true
|
|
160
|
+
: blockQuote === 'folded' || type === Scalar.BLOCK_FOLDED
|
|
161
|
+
? false
|
|
162
|
+
: type === Scalar.BLOCK_LITERAL
|
|
163
|
+
? true
|
|
164
|
+
: !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
149
165
|
if (!value)
|
|
150
166
|
return literal ? '|\n' : '>\n';
|
|
151
167
|
// determine chomping from whitespace at value end
|
|
@@ -196,7 +212,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
|
196
212
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
197
213
|
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
198
214
|
if (comment) {
|
|
199
|
-
header += '
|
|
215
|
+
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
200
216
|
if (onComment)
|
|
201
217
|
onComment();
|
|
202
218
|
}
|
|
@@ -209,70 +225,57 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
|
209
225
|
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
210
226
|
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
211
227
|
.replace(/\n+/g, `$&${indent}`);
|
|
212
|
-
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx));
|
|
228
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
213
229
|
return `${header}\n${indent}${body}`;
|
|
214
230
|
}
|
|
215
231
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
216
|
-
var _a;
|
|
217
232
|
const { type, value } = item;
|
|
218
|
-
const { actualString, implicitKey, indent, inFlow } = ctx;
|
|
233
|
+
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
|
219
234
|
if ((implicitKey && /[\n[\]{},]/.test(value)) ||
|
|
220
235
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
221
|
-
return
|
|
236
|
+
return quotedString(value, ctx);
|
|
222
237
|
}
|
|
223
238
|
if (!value ||
|
|
224
239
|
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
225
|
-
const hasDouble = value.indexOf('"') !== -1;
|
|
226
|
-
const hasSingle = value.indexOf("'") !== -1;
|
|
227
|
-
let quotedString;
|
|
228
|
-
if (hasDouble && !hasSingle) {
|
|
229
|
-
quotedString = singleQuotedString;
|
|
230
|
-
}
|
|
231
|
-
else if (hasSingle && !hasDouble) {
|
|
232
|
-
quotedString = doubleQuotedString;
|
|
233
|
-
}
|
|
234
|
-
else if (ctx.options.singleQuote) {
|
|
235
|
-
quotedString = singleQuotedString;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
quotedString = doubleQuotedString;
|
|
239
|
-
}
|
|
240
240
|
// not allowed:
|
|
241
241
|
// - empty string, '-' or '?'
|
|
242
242
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
243
243
|
// - '\n ', ': ' or ' \n' anywhere
|
|
244
244
|
// - '#' not preceded by a non-space char
|
|
245
245
|
// - end with ' ' or ':'
|
|
246
|
-
return implicitKey || inFlow || value.
|
|
246
|
+
return implicitKey || inFlow || !value.includes('\n')
|
|
247
247
|
? quotedString(value, ctx)
|
|
248
248
|
: blockString(item, ctx, onComment, onChompKeep);
|
|
249
249
|
}
|
|
250
250
|
if (!implicitKey &&
|
|
251
251
|
!inFlow &&
|
|
252
252
|
type !== Scalar.PLAIN &&
|
|
253
|
-
value.
|
|
253
|
+
value.includes('\n')) {
|
|
254
254
|
// Where allowed & type not set explicitly, prefer block style for multiline strings
|
|
255
255
|
return blockString(item, ctx, onComment, onChompKeep);
|
|
256
256
|
}
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
if (containsDocumentMarker(value)) {
|
|
258
|
+
if (indent === '') {
|
|
259
|
+
ctx.forceBlockIndent = true;
|
|
260
|
+
return blockString(item, ctx, onComment, onChompKeep);
|
|
261
|
+
}
|
|
262
|
+
else if (implicitKey && indent === indentStep) {
|
|
263
|
+
return quotedString(value, ctx);
|
|
264
|
+
}
|
|
260
265
|
}
|
|
261
266
|
const str = value.replace(/\n+/g, `$&\n${indent}`);
|
|
262
267
|
// Verify that output will be parsed as a string, as e.g. plain numbers and
|
|
263
268
|
// booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
|
|
264
269
|
// and others in v1.1.
|
|
265
270
|
if (actualString) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return doubleQuotedString(value, ctx);
|
|
271
|
-
}
|
|
271
|
+
const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);
|
|
272
|
+
const { compat, tags } = ctx.doc.schema;
|
|
273
|
+
if (tags.some(test) || compat?.some(test))
|
|
274
|
+
return quotedString(value, ctx);
|
|
272
275
|
}
|
|
273
276
|
return implicitKey
|
|
274
277
|
? str
|
|
275
|
-
: foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx));
|
|
278
|
+
: foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
276
279
|
}
|
|
277
280
|
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
278
281
|
const { implicitKey, inFlow } = ctx;
|
|
@@ -290,7 +293,7 @@ function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
|
290
293
|
case Scalar.BLOCK_FOLDED:
|
|
291
294
|
case Scalar.BLOCK_LITERAL:
|
|
292
295
|
return implicitKey || inFlow
|
|
293
|
-
?
|
|
296
|
+
? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
|
|
294
297
|
: blockString(ss, ctx, onComment, onChompKeep);
|
|
295
298
|
case Scalar.QUOTE_DOUBLE:
|
|
296
299
|
return doubleQuotedString(ss.value, ctx);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { debug, warn } from './log.js';
|
|
2
2
|
export { findPair } from './nodes/YAMLMap.js';
|
|
3
3
|
export { toJS } from './nodes/toJS.js';
|
|
4
|
+
export { map as mapTag } from './schema/common/map.js';
|
|
5
|
+
export { seq as seqTag } from './schema/common/seq.js';
|
|
6
|
+
export { string as stringTag } from './schema/common/string.js';
|
|
4
7
|
export { foldFlowLines } from './stringify/foldFlowLines.js';
|
|
5
8
|
export { stringifyNumber } from './stringify/stringifyNumber.js';
|
|
6
9
|
export { stringifyString } from './stringify/stringifyString.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDocument,
|
|
1
|
+
import { isDocument, isNode, isPair, isCollection, isMap, isSeq, isScalar, isAlias } from './nodes/Node.js';
|
|
2
2
|
|
|
3
3
|
const BREAK = Symbol('break visit');
|
|
4
4
|
const SKIP = Symbol('skip children');
|
|
@@ -34,29 +34,14 @@ const REMOVE = Symbol('remove node');
|
|
|
34
34
|
* specific defined one will be used for each node.
|
|
35
35
|
*/
|
|
36
36
|
function visit(node, visitor) {
|
|
37
|
-
|
|
38
|
-
(visitor.Collection || visitor.Node || visitor.Value)) {
|
|
39
|
-
visitor = Object.assign({
|
|
40
|
-
Alias: visitor.Node,
|
|
41
|
-
Map: visitor.Node,
|
|
42
|
-
Scalar: visitor.Node,
|
|
43
|
-
Seq: visitor.Node
|
|
44
|
-
}, visitor.Value && {
|
|
45
|
-
Map: visitor.Value,
|
|
46
|
-
Scalar: visitor.Value,
|
|
47
|
-
Seq: visitor.Value
|
|
48
|
-
}, visitor.Collection && {
|
|
49
|
-
Map: visitor.Collection,
|
|
50
|
-
Seq: visitor.Collection
|
|
51
|
-
}, visitor);
|
|
52
|
-
}
|
|
37
|
+
const visitor_ = initVisitor(visitor);
|
|
53
38
|
if (isDocument(node)) {
|
|
54
|
-
const cd =
|
|
39
|
+
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
|
|
55
40
|
if (cd === REMOVE)
|
|
56
41
|
node.contents = null;
|
|
57
42
|
}
|
|
58
43
|
else
|
|
59
|
-
|
|
44
|
+
visit_(null, node, visitor_, Object.freeze([]));
|
|
60
45
|
}
|
|
61
46
|
// Without the `as symbol` casts, TS declares these in the `visit`
|
|
62
47
|
// namespace using `var`, but then complains about that because
|
|
@@ -67,55 +52,104 @@ visit.BREAK = BREAK;
|
|
|
67
52
|
visit.SKIP = SKIP;
|
|
68
53
|
/** Remove the current node */
|
|
69
54
|
visit.REMOVE = REMOVE;
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (visitor.Map)
|
|
76
|
-
ctrl = visitor.Map(key, node, path);
|
|
77
|
-
}
|
|
78
|
-
else if (isSeq(node)) {
|
|
79
|
-
if (visitor.Seq)
|
|
80
|
-
ctrl = visitor.Seq(key, node, path);
|
|
81
|
-
}
|
|
82
|
-
else if (isPair(node)) {
|
|
83
|
-
if (visitor.Pair)
|
|
84
|
-
ctrl = visitor.Pair(key, node, path);
|
|
55
|
+
function visit_(key, node, visitor, path) {
|
|
56
|
+
const ctrl = callVisitor(key, node, visitor, path);
|
|
57
|
+
if (isNode(ctrl) || isPair(ctrl)) {
|
|
58
|
+
replaceNode(key, path, ctrl);
|
|
59
|
+
return visit_(key, ctrl, visitor, path);
|
|
85
60
|
}
|
|
86
|
-
|
|
87
|
-
if (
|
|
88
|
-
|
|
61
|
+
if (typeof ctrl !== 'symbol') {
|
|
62
|
+
if (isCollection(node)) {
|
|
63
|
+
path = Object.freeze(path.concat(node));
|
|
64
|
+
for (let i = 0; i < node.items.length; ++i) {
|
|
65
|
+
const ci = visit_(i, node.items[i], visitor, path);
|
|
66
|
+
if (typeof ci === 'number')
|
|
67
|
+
i = ci - 1;
|
|
68
|
+
else if (ci === BREAK)
|
|
69
|
+
return BREAK;
|
|
70
|
+
else if (ci === REMOVE) {
|
|
71
|
+
node.items.splice(i, 1);
|
|
72
|
+
i -= 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else if (isPair(node)) {
|
|
77
|
+
path = Object.freeze(path.concat(node));
|
|
78
|
+
const ck = visit_('key', node.key, visitor, path);
|
|
79
|
+
if (ck === BREAK)
|
|
80
|
+
return BREAK;
|
|
81
|
+
else if (ck === REMOVE)
|
|
82
|
+
node.key = null;
|
|
83
|
+
const cv = visit_('value', node.value, visitor, path);
|
|
84
|
+
if (cv === BREAK)
|
|
85
|
+
return BREAK;
|
|
86
|
+
else if (cv === REMOVE)
|
|
87
|
+
node.value = null;
|
|
88
|
+
}
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
return ctrl;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Apply an async visitor to an AST node or document.
|
|
94
|
+
*
|
|
95
|
+
* Walks through the tree (depth-first) starting from `node`, calling a
|
|
96
|
+
* `visitor` function with three arguments:
|
|
97
|
+
* - `key`: For sequence values and map `Pair`, the node's index in the
|
|
98
|
+
* collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
|
|
99
|
+
* `null` for the root node.
|
|
100
|
+
* - `node`: The current node.
|
|
101
|
+
* - `path`: The ancestry of the current node.
|
|
102
|
+
*
|
|
103
|
+
* The return value of the visitor may be used to control the traversal:
|
|
104
|
+
* - `Promise`: Must resolve to one of the following values
|
|
105
|
+
* - `undefined` (default): Do nothing and continue
|
|
106
|
+
* - `visit.SKIP`: Do not visit the children of this node, continue with next
|
|
107
|
+
* sibling
|
|
108
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
109
|
+
* - `visit.REMOVE`: Remove the current node, then continue with the next one
|
|
110
|
+
* - `Node`: Replace the current node, then continue by visiting it
|
|
111
|
+
* - `number`: While iterating the items of a sequence or map, set the index
|
|
112
|
+
* of the next step. This is useful especially if the index of the current
|
|
113
|
+
* node has changed.
|
|
114
|
+
*
|
|
115
|
+
* If `visitor` is a single function, it will be called with all values
|
|
116
|
+
* encountered in the tree, including e.g. `null` values. Alternatively,
|
|
117
|
+
* separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
|
|
118
|
+
* `Alias` and `Scalar` node. To define the same visitor function for more than
|
|
119
|
+
* one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
|
|
120
|
+
* and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
|
|
121
|
+
* specific defined one will be used for each node.
|
|
122
|
+
*/
|
|
123
|
+
async function visitAsync(node, visitor) {
|
|
124
|
+
const visitor_ = initVisitor(visitor);
|
|
125
|
+
if (isDocument(node)) {
|
|
126
|
+
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
|
|
127
|
+
if (cd === REMOVE)
|
|
128
|
+
node.contents = null;
|
|
93
129
|
}
|
|
130
|
+
else
|
|
131
|
+
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
132
|
+
}
|
|
133
|
+
// Without the `as symbol` casts, TS declares these in the `visit`
|
|
134
|
+
// namespace using `var`, but then complains about that because
|
|
135
|
+
// `unique symbol` must be `const`.
|
|
136
|
+
/** Terminate visit traversal completely */
|
|
137
|
+
visitAsync.BREAK = BREAK;
|
|
138
|
+
/** Do not visit the children of the current node */
|
|
139
|
+
visitAsync.SKIP = SKIP;
|
|
140
|
+
/** Remove the current node */
|
|
141
|
+
visitAsync.REMOVE = REMOVE;
|
|
142
|
+
async function visitAsync_(key, node, visitor, path) {
|
|
143
|
+
const ctrl = await callVisitor(key, node, visitor, path);
|
|
94
144
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
parent.items[key] = ctrl;
|
|
98
|
-
}
|
|
99
|
-
else if (isPair(parent)) {
|
|
100
|
-
if (key === 'key')
|
|
101
|
-
parent.key = ctrl;
|
|
102
|
-
else
|
|
103
|
-
parent.value = ctrl;
|
|
104
|
-
}
|
|
105
|
-
else if (isDocument(parent)) {
|
|
106
|
-
parent.contents = ctrl;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
const pt = isAlias(parent) ? 'alias' : 'scalar';
|
|
110
|
-
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
111
|
-
}
|
|
112
|
-
return _visit(key, ctrl, visitor, path);
|
|
145
|
+
replaceNode(key, path, ctrl);
|
|
146
|
+
return visitAsync_(key, ctrl, visitor, path);
|
|
113
147
|
}
|
|
114
148
|
if (typeof ctrl !== 'symbol') {
|
|
115
149
|
if (isCollection(node)) {
|
|
116
150
|
path = Object.freeze(path.concat(node));
|
|
117
151
|
for (let i = 0; i < node.items.length; ++i) {
|
|
118
|
-
const ci =
|
|
152
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path);
|
|
119
153
|
if (typeof ci === 'number')
|
|
120
154
|
i = ci - 1;
|
|
121
155
|
else if (ci === BREAK)
|
|
@@ -128,12 +162,12 @@ function _visit(key, node, visitor, path) {
|
|
|
128
162
|
}
|
|
129
163
|
else if (isPair(node)) {
|
|
130
164
|
path = Object.freeze(path.concat(node));
|
|
131
|
-
const ck =
|
|
165
|
+
const ck = await visitAsync_('key', node.key, visitor, path);
|
|
132
166
|
if (ck === BREAK)
|
|
133
167
|
return BREAK;
|
|
134
168
|
else if (ck === REMOVE)
|
|
135
169
|
node.key = null;
|
|
136
|
-
const cv =
|
|
170
|
+
const cv = await visitAsync_('value', node.value, visitor, path);
|
|
137
171
|
if (cv === BREAK)
|
|
138
172
|
return BREAK;
|
|
139
173
|
else if (cv === REMOVE)
|
|
@@ -142,5 +176,58 @@ function _visit(key, node, visitor, path) {
|
|
|
142
176
|
}
|
|
143
177
|
return ctrl;
|
|
144
178
|
}
|
|
179
|
+
function initVisitor(visitor) {
|
|
180
|
+
if (typeof visitor === 'object' &&
|
|
181
|
+
(visitor.Collection || visitor.Node || visitor.Value)) {
|
|
182
|
+
return Object.assign({
|
|
183
|
+
Alias: visitor.Node,
|
|
184
|
+
Map: visitor.Node,
|
|
185
|
+
Scalar: visitor.Node,
|
|
186
|
+
Seq: visitor.Node
|
|
187
|
+
}, visitor.Value && {
|
|
188
|
+
Map: visitor.Value,
|
|
189
|
+
Scalar: visitor.Value,
|
|
190
|
+
Seq: visitor.Value
|
|
191
|
+
}, visitor.Collection && {
|
|
192
|
+
Map: visitor.Collection,
|
|
193
|
+
Seq: visitor.Collection
|
|
194
|
+
}, visitor);
|
|
195
|
+
}
|
|
196
|
+
return visitor;
|
|
197
|
+
}
|
|
198
|
+
function callVisitor(key, node, visitor, path) {
|
|
199
|
+
if (typeof visitor === 'function')
|
|
200
|
+
return visitor(key, node, path);
|
|
201
|
+
if (isMap(node))
|
|
202
|
+
return visitor.Map?.(key, node, path);
|
|
203
|
+
if (isSeq(node))
|
|
204
|
+
return visitor.Seq?.(key, node, path);
|
|
205
|
+
if (isPair(node))
|
|
206
|
+
return visitor.Pair?.(key, node, path);
|
|
207
|
+
if (isScalar(node))
|
|
208
|
+
return visitor.Scalar?.(key, node, path);
|
|
209
|
+
if (isAlias(node))
|
|
210
|
+
return visitor.Alias?.(key, node, path);
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
function replaceNode(key, path, node) {
|
|
214
|
+
const parent = path[path.length - 1];
|
|
215
|
+
if (isCollection(parent)) {
|
|
216
|
+
parent.items[key] = node;
|
|
217
|
+
}
|
|
218
|
+
else if (isPair(parent)) {
|
|
219
|
+
if (key === 'key')
|
|
220
|
+
parent.key = node;
|
|
221
|
+
else
|
|
222
|
+
parent.value = node;
|
|
223
|
+
}
|
|
224
|
+
else if (isDocument(parent)) {
|
|
225
|
+
parent.contents = node;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const pt = isAlias(parent) ? 'alias' : 'scalar';
|
|
229
|
+
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
145
232
|
|
|
146
|
-
export { visit };
|
|
233
|
+
export { visit, visitAsync };
|
|
@@ -53,7 +53,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) {
|
|
|
53
53
|
: new Scalar.Scalar(res);
|
|
54
54
|
node.range = coll.range;
|
|
55
55
|
node.tag = tagName;
|
|
56
|
-
if (tag
|
|
56
|
+
if (tag?.format)
|
|
57
57
|
node.format = tag.format;
|
|
58
58
|
return node;
|
|
59
59
|
}
|
|
@@ -6,22 +6,23 @@ var resolveEnd = require('./resolve-end.js');
|
|
|
6
6
|
var resolveProps = require('./resolve-props.js');
|
|
7
7
|
|
|
8
8
|
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
9
|
-
const opts = Object.assign({ directives }, options);
|
|
9
|
+
const opts = Object.assign({ _directives: directives }, options);
|
|
10
10
|
const doc = new Document.Document(undefined, opts);
|
|
11
11
|
const ctx = {
|
|
12
|
+
atRoot: true,
|
|
12
13
|
directives: doc.directives,
|
|
13
14
|
options: doc.options,
|
|
14
15
|
schema: doc.schema
|
|
15
16
|
};
|
|
16
17
|
const props = resolveProps.resolveProps(start, {
|
|
17
18
|
indicator: 'doc-start',
|
|
18
|
-
next: value
|
|
19
|
+
next: value ?? end?.[0],
|
|
19
20
|
offset,
|
|
20
21
|
onError,
|
|
21
22
|
startOnNewline: true
|
|
22
23
|
});
|
|
23
24
|
if (props.found) {
|
|
24
|
-
doc.directives.
|
|
25
|
+
doc.directives.docStart = true;
|
|
25
26
|
if (value &&
|
|
26
27
|
(value.type === 'block-map' || value.type === 'block-seq') &&
|
|
27
28
|
!props.hasNewline)
|
|
@@ -5,6 +5,7 @@ import type { SourceToken, Token } from '../parse/cst.js';
|
|
|
5
5
|
import type { Schema } from '../schema/Schema.js';
|
|
6
6
|
import type { ComposeErrorHandler } from './composer.js';
|
|
7
7
|
export interface ComposeContext {
|
|
8
|
+
atRoot: boolean;
|
|
8
9
|
directives: Directives;
|
|
9
10
|
options: Readonly<Required<Omit<ParseOptions, 'lineCounter'>>>;
|
|
10
11
|
schema: Readonly<Schema>;
|
|
@@ -14,12 +15,13 @@ interface Props {
|
|
|
14
15
|
comment: string;
|
|
15
16
|
anchor: SourceToken | null;
|
|
16
17
|
tag: SourceToken | null;
|
|
18
|
+
end: number;
|
|
17
19
|
}
|
|
18
20
|
declare const CN: {
|
|
19
21
|
composeNode: typeof composeNode;
|
|
20
22
|
composeEmptyNode: typeof composeEmptyNode;
|
|
21
23
|
};
|
|
22
|
-
export
|
|
24
|
+
export type ComposeNode = typeof CN;
|
|
23
25
|
export declare function composeNode(ctx: ComposeContext, token: Token, props: Props, onError: ComposeErrorHandler): ParsedNode;
|
|
24
|
-
export declare function composeEmptyNode(ctx: ComposeContext, offset: number, before: Token[] | undefined, pos: number | null, { spaceBefore, comment, anchor, tag }: Props, onError: ComposeErrorHandler): import("../index.js").Scalar.Parsed;
|
|
26
|
+
export declare function composeEmptyNode(ctx: ComposeContext, offset: number, before: Token[] | undefined, pos: number | null, { spaceBefore, comment, anchor, tag, end }: Props, onError: ComposeErrorHandler): import("../index.js").Scalar.Parsed;
|
|
25
27
|
export {};
|