Skip to content

Commit 03603cc

Browse files
GitHub Actionsomkhegde
GitHub Actions
authored andcommitted
chore: Update dist
1 parent b6ebea9 commit 03603cc

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

dist/index.js

+24-15
Original file line numberDiff line numberDiff line change
@@ -63614,10 +63614,23 @@ function resolveCollection(CN, ctx, token, onError, tagName, tag) {
6361463614
coll.tag = tagName;
6361563615
return coll;
6361663616
}
63617-
function composeCollection(CN, ctx, token, tagToken, onError) {
63617+
function composeCollection(CN, ctx, token, props, onError) {
63618+
const tagToken = props.tag;
6361863619
const tagName = !tagToken
6361963620
? null
6362063621
: ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
63622+
if (token.type === 'block-seq') {
63623+
const { anchor, newlineAfterProp: nl } = props;
63624+
const lastProp = anchor && tagToken
63625+
? anchor.offset > tagToken.offset
63626+
? anchor
63627+
: tagToken
63628+
: (anchor ?? tagToken);
63629+
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
63630+
const message = 'Missing newline after block sequence props';
63631+
onError(lastProp, 'MISSING_CHAR', message);
63632+
}
63633+
}
6362163634
const expType = token.type === 'block-map'
6362263635
? 'map'
6362363636
: token.type === 'block-seq'
@@ -63631,8 +63644,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) {
6363163644
!tagName ||
6363263645
tagName === '!' ||
6363363646
(tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||
63634-
(tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq') ||
63635-
!expType) {
63647+
(tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {
6363663648
return resolveCollection(CN, ctx, token, onError, tagName);
6363763649
}
6363863650
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
@@ -63755,7 +63767,7 @@ function composeNode(ctx, token, props, onError) {
6375563767
case 'block-map':
6375663768
case 'block-seq':
6375763769
case 'flow-collection':
63758-
node = composeCollection.composeCollection(CN, ctx, token, tag, onError);
63770+
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
6375963771
if (anchor)
6376063772
node.anchor = anchor.source.substring(1);
6376163773
break;
@@ -64193,7 +64205,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
6419364205
}
6419464206
continue;
6419564207
}
64196-
if (keyProps.hasNewlineAfterProp || utilContainsNewline.containsNewline(key)) {
64208+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
6419764209
onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
6419864210
}
6419964211
}
@@ -65035,11 +65047,11 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6503565047
let comment = '';
6503665048
let commentSep = '';
6503765049
let hasNewline = false;
65038-
let hasNewlineAfterProp = false;
6503965050
let reqSpace = false;
6504065051
let tab = null;
6504165052
let anchor = null;
6504265053
let tag = null;
65054+
let newlineAfterProp = null;
6504365055
let comma = null;
6504465056
let found = null;
6504565057
let start = null;
@@ -65093,7 +65105,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6509365105
atNewline = true;
6509465106
hasNewline = true;
6509565107
if (anchor || tag)
65096-
hasNewlineAfterProp = true;
65108+
newlineAfterProp = token;
6509765109
hasSpace = true;
6509865110
break;
6509965111
case 'anchor':
@@ -65167,9 +65179,9 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6516765179
spaceBefore,
6516865180
comment,
6516965181
hasNewline,
65170-
hasNewlineAfterProp,
6517165182
anchor,
6517265183
tag,
65184+
newlineAfterProp,
6517365185
end,
6517465186
start: start ?? end
6517565187
};
@@ -66508,7 +66520,6 @@ class Collection extends Node.NodeBase {
6650866520
}
6650966521
}
6651066522
}
66511-
Collection.maxFlowStringSingleLineLength = 60;
6651266523

6651366524
exports.Collection = Collection;
6651466525
exports.collectionFromPath = collectionFromPath;
@@ -67969,15 +67980,11 @@ class Lexer {
6796967980
if (!this.atEnd && !this.hasChars(4))
6797067981
return this.setNext('line-start');
6797167982
const s = this.peek(3);
67972-
if (s === '---' && isEmpty(this.charAt(3))) {
67983+
if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
6797367984
yield* this.pushCount(3);
6797467985
this.indentValue = 0;
6797567986
this.indentNext = 0;
67976-
return 'doc';
67977-
}
67978-
else if (s === '...' && isEmpty(this.charAt(3))) {
67979-
yield* this.pushCount(3);
67980-
return 'stream';
67987+
return s === '---' ? 'doc' : 'stream';
6798167988
}
6798267989
}
6798367990
this.indentValue = yield* this.pushSpaces(false);
@@ -70722,6 +70729,8 @@ const FOLD_QUOTED = 'quoted';
7072270729
function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
7072370730
if (!lineWidth || lineWidth < 0)
7072470731
return text;
70732+
if (lineWidth < minContentWidth)
70733+
minContentWidth = 0;
7072570734
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
7072670735
if (text.length <= endStep)
7072770736
return text;

0 commit comments

Comments
 (0)