Skip to content

Commit 9d978a3

Browse files
dependabot[bot]GitHub Actionsamazreech
authored
chore: Bump yaml from 2.4.3 to 2.4.5 (#565)
* chore: Bump yaml from 2.4.3 to 2.4.5 Bumps [yaml](https://github.com/eemeli/yaml) from 2.4.3 to 2.4.5. - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](eemeli/yaml@v2.4.3...v2.4.5) --- updated-dependencies: - dependency-name: yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * chore: Update dist --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions <runner@fv-az973-470.lyxwbwkowfpetlaump2twx55qb.ex.internal.cloudapp.net> Co-authored-by: Reecha Khanal <[email protected]>
1 parent 483b043 commit 9d978a3

File tree

3 files changed

+80
-44
lines changed

3 files changed

+80
-44
lines changed

dist/index.js

Lines changed: 75 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -67194,6 +67194,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
6719467194
next: value ?? end?.[0],
6719567195
offset,
6719667196
onError,
67197+
parentIndent: 0,
6719767198
startOnNewline: true
6719867199
});
6719967200
if (props.found) {
@@ -67336,7 +67337,7 @@ var resolveFlowScalar = __nccwpck_require__(261);
6733667337

6733767338
function composeScalar(ctx, token, tagToken, onError) {
6733867339
const { value, type, comment, range } = token.type === 'block-scalar'
67339-
? resolveBlockScalar.resolveBlockScalar(token, ctx.options.strict, onError)
67340+
? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)
6734067341
: resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
6734167342
const tagName = tagToken
6734267343
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
@@ -67671,6 +67672,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
6767167672
next: key ?? sep?.[0],
6767267673
offset,
6767367674
onError,
67675+
parentIndent: bm.indent,
6767467676
startOnNewline: true
6767567677
});
6767667678
const implicitKey = !keyProps.found;
@@ -67713,6 +67715,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
6771367715
next: value,
6771467716
offset: keyNode.range[2],
6771567717
onError,
67718+
parentIndent: bm.indent,
6771667719
startOnNewline: !key || key.type === 'block-scalar'
6771767720
});
6771867721
offset = valueProps.end;
@@ -67771,9 +67774,9 @@ exports.resolveBlockMap = resolveBlockMap;
6777167774

6777267775
var Scalar = __nccwpck_require__(9338);
6777367776

67774-
function resolveBlockScalar(scalar, strict, onError) {
67777+
function resolveBlockScalar(ctx, scalar, onError) {
6777567778
const start = scalar.offset;
67776-
const header = parseBlockScalarHeader(scalar, strict, onError);
67779+
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
6777767780
if (!header)
6777867781
return { value: '', type: null, comment: '', range: [start, start, start] };
6777967782
const type = header.mode === '>' ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
@@ -67815,6 +67818,10 @@ function resolveBlockScalar(scalar, strict, onError) {
6781567818
if (header.indent === 0)
6781667819
trimIndent = indent.length;
6781767820
contentStart = i;
67821+
if (trimIndent === 0 && !ctx.atRoot) {
67822+
const message = 'Block scalar values in collections must be indented';
67823+
onError(offset, 'BAD_INDENT', message);
67824+
}
6781867825
break;
6781967826
}
6782067827
offset += indent.length + content.length + 1;
@@ -67990,6 +67997,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, ta
6799067997
next: value,
6799167998
offset,
6799267999
onError,
68000+
parentIndent: bs.indent,
6799368001
startOnNewline: true
6799468002
});
6799568003
if (!props.found) {
@@ -68106,6 +68114,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
6810668114
next: key ?? sep?.[0],
6810768115
offset,
6810868116
onError,
68117+
parentIndent: fc.indent,
6810968118
startOnNewline: false
6811068119
});
6811168120
if (!props.found) {
@@ -68187,6 +68196,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
6818768196
next: value,
6818868197
offset: keyNode.range[2],
6818968198
onError,
68199+
parentIndent: fc.indent,
6819068200
startOnNewline: false
6819168201
});
6819268202
if (valueProps.found) {
@@ -68518,7 +68528,7 @@ exports.resolveFlowScalar = resolveFlowScalar;
6851868528
"use strict";
6851968529

6852068530

68521-
function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) {
68531+
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
6852268532
let spaceBefore = false;
6852368533
let atNewline = startOnNewline;
6852468534
let hasSpace = startOnNewline;
@@ -68527,6 +68537,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
6852768537
let hasNewline = false;
6852868538
let hasNewlineAfterProp = false;
6852968539
let reqSpace = false;
68540+
let tab = null;
6853068541
let anchor = null;
6853168542
let tag = null;
6853268543
let comma = null;
@@ -68540,16 +68551,22 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
6854068551
onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
6854168552
reqSpace = false;
6854268553
}
68554+
if (tab) {
68555+
if (atNewline && token.type !== 'comment' && token.type !== 'newline') {
68556+
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
68557+
}
68558+
tab = null;
68559+
}
6854368560
switch (token.type) {
6854468561
case 'space':
6854568562
// At the doc level, tabs at line start may be parsed
6854668563
// as leading white space rather than indentation.
6854768564
// In a flow collection, only the parser handles indent.
6854868565
if (!flow &&
68549-
atNewline &&
68550-
indicator !== 'doc-start' &&
68551-
token.source[0] === '\t')
68552-
onError(token, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
68566+
(indicator !== 'doc-start' || next?.type !== 'flow-collection') &&
68567+
token.source.includes('\t')) {
68568+
tab = token;
68569+
}
6855368570
hasSpace = true;
6855468571
break;
6855568572
case 'comment': {
@@ -68609,7 +68626,8 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
6860968626
if (found)
6861068627
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);
6861168628
found = token;
68612-
atNewline = false;
68629+
atNewline =
68630+
indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';
6861368631
hasSpace = false;
6861468632
break;
6861568633
case 'comma':
@@ -68635,8 +68653,14 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
6863568653
next.type !== 'space' &&
6863668654
next.type !== 'newline' &&
6863768655
next.type !== 'comma' &&
68638-
(next.type !== 'scalar' || next.source !== ''))
68656+
(next.type !== 'scalar' || next.source !== '')) {
6863968657
onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
68658+
}
68659+
if (tab &&
68660+
((atNewline && tab.indent <= parentIndent) ||
68661+
next?.type === 'block-map' ||
68662+
next?.type === 'block-seq'))
68663+
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
6864068664
return {
6864168665
comma,
6864268666
found,
@@ -70649,7 +70673,7 @@ function resolveAsScalar(token, strict = true, onError) {
7064970673
case 'double-quoted-scalar':
7065070674
return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
7065170675
case 'block-scalar':
70652-
return resolveBlockScalar.resolveBlockScalar(token, strict, _onError);
70676+
return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
7065370677
}
7065470678
}
7065570679
return null;
@@ -71234,11 +71258,11 @@ function isEmpty(ch) {
7123471258
return false;
7123571259
}
7123671260
}
71237-
const hexDigits = '0123456789ABCDEFabcdef'.split('');
71238-
const tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split('');
71239-
const invalidFlowScalarChars = ',[]{}'.split('');
71240-
const invalidAnchorChars = ' ,[]{}\n\r\t'.split('');
71241-
const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.includes(ch);
71261+
const hexDigits = new Set('0123456789ABCDEFabcdef');
71262+
const tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
71263+
const flowIndicatorChars = new Set(',[]{}');
71264+
const invalidAnchorChars = new Set(' ,[]{}\n\r\t');
71265+
const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
7124271266
/**
7124371267
* Splits an input string into lexical tokens, i.e. smaller strings that are
7124471268
* easily identifiable by `tokens.tokenType()`.
@@ -71680,8 +71704,10 @@ class Lexer {
7168071704
if (indent >= this.indentNext) {
7168171705
if (this.blockScalarIndent === -1)
7168271706
this.indentNext = indent;
71683-
else
71684-
this.indentNext += this.blockScalarIndent;
71707+
else {
71708+
this.indentNext =
71709+
this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
71710+
}
7168571711
do {
7168671712
const cs = this.continueScalar(nl + 1);
7168771713
if (cs === -1)
@@ -71694,14 +71720,25 @@ class Lexer {
7169471720
nl = this.buffer.length;
7169571721
}
7169671722
}
71697-
if (!this.blockScalarKeep) {
71723+
// Trailing insufficiently indented tabs are invalid.
71724+
// To catch that during parsing, we include them in the block scalar value.
71725+
let i = nl + 1;
71726+
ch = this.buffer[i];
71727+
while (ch === ' ')
71728+
ch = this.buffer[++i];
71729+
if (ch === '\t') {
71730+
while (ch === '\t' || ch === ' ' || ch === '\r' || ch === '\n')
71731+
ch = this.buffer[++i];
71732+
nl = i - 1;
71733+
}
71734+
else if (!this.blockScalarKeep) {
7169871735
do {
7169971736
let i = nl - 1;
7170071737
let ch = this.buffer[i];
7170171738
if (ch === '\r')
7170271739
ch = this.buffer[--i];
7170371740
const lastChar = i; // Drop the line if last char not more indented
71704-
while (ch === ' ' || ch === '\t')
71741+
while (ch === ' ')
7170571742
ch = this.buffer[--i];
7170671743
if (ch === '\n' && i >= this.pos && i + 1 + indent > lastChar)
7170771744
nl = i;
@@ -71721,7 +71758,7 @@ class Lexer {
7172171758
while ((ch = this.buffer[++i])) {
7172271759
if (ch === ':') {
7172371760
const next = this.buffer[i + 1];
71724-
if (isEmpty(next) || (inFlow && next === ','))
71761+
if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))
7172571762
break;
7172671763
end = i;
7172771764
}
@@ -71736,7 +71773,7 @@ class Lexer {
7173671773
else
7173771774
end = i;
7173871775
}
71739-
if (next === '#' || (inFlow && invalidFlowScalarChars.includes(next)))
71776+
if (next === '#' || (inFlow && flowIndicatorChars.has(next)))
7174071777
break;
7174171778
if (ch === '\n') {
7174271779
const cs = this.continueScalar(i + 1);
@@ -71746,7 +71783,7 @@ class Lexer {
7174671783
}
7174771784
}
7174871785
else {
71749-
if (inFlow && invalidFlowScalarChars.includes(ch))
71786+
if (inFlow && flowIndicatorChars.has(ch))
7175071787
break;
7175171788
end = i;
7175271789
}
@@ -71791,7 +71828,7 @@ class Lexer {
7179171828
case ':': {
7179271829
const inFlow = this.flowLevel > 0;
7179371830
const ch1 = this.charAt(1);
71794-
if (isEmpty(ch1) || (inFlow && invalidFlowScalarChars.includes(ch1))) {
71831+
if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
7179571832
if (!inFlow)
7179671833
this.indentNext = this.indentValue + 1;
7179771834
else if (this.flowKey)
@@ -71816,11 +71853,11 @@ class Lexer {
7181671853
let i = this.pos + 1;
7181771854
let ch = this.buffer[i];
7181871855
while (ch) {
71819-
if (tagChars.includes(ch))
71856+
if (tagChars.has(ch))
7182071857
ch = this.buffer[++i];
7182171858
else if (ch === '%' &&
71822-
hexDigits.includes(this.buffer[i + 1]) &&
71823-
hexDigits.includes(this.buffer[i + 2])) {
71859+
hexDigits.has(this.buffer[i + 1]) &&
71860+
hexDigits.has(this.buffer[i + 2])) {
7182471861
ch = this.buffer[(i += 3)];
7182571862
}
7182671863
else
@@ -72228,7 +72265,7 @@ class Parser {
7222872265
}
7222972266
else {
7223072267
Object.assign(it, { key: token, sep: [] });
72231-
this.onKeyLine = !includesToken(it.start, 'explicit-key-ind');
72268+
this.onKeyLine = !it.explicitKey;
7223272269
return;
7223372270
}
7223472271
break;
@@ -72437,9 +72474,9 @@ class Parser {
7243772474
return;
7243872475
}
7243972476
if (this.indent >= map.indent) {
72440-
const atNextItem = !this.onKeyLine &&
72441-
this.indent === map.indent &&
72442-
it.sep &&
72477+
const atMapIndent = !this.onKeyLine && this.indent === map.indent;
72478+
const atNextItem = atMapIndent &&
72479+
(it.sep || it.explicitKey) &&
7244372480
this.type !== 'seq-item-ind';
7244472481
// For empty nodes, assign newline-separated not indented empty tokens to following node
7244572482
let start = [];
@@ -72480,25 +72517,26 @@ class Parser {
7248072517
}
7248172518
return;
7248272519
case 'explicit-key-ind':
72483-
if (!it.sep && !includesToken(it.start, 'explicit-key-ind')) {
72520+
if (!it.sep && !it.explicitKey) {
7248472521
it.start.push(this.sourceToken);
72522+
it.explicitKey = true;
7248572523
}
7248672524
else if (atNextItem || it.value) {
7248772525
start.push(this.sourceToken);
72488-
map.items.push({ start });
72526+
map.items.push({ start, explicitKey: true });
7248972527
}
7249072528
else {
7249172529
this.stack.push({
7249272530
type: 'block-map',
7249372531
offset: this.offset,
7249472532
indent: this.indent,
72495-
items: [{ start: [this.sourceToken] }]
72533+
items: [{ start: [this.sourceToken], explicitKey: true }]
7249672534
});
7249772535
}
7249872536
this.onKeyLine = true;
7249972537
return;
7250072538
case 'map-value-ind':
72501-
if (includesToken(it.start, 'explicit-key-ind')) {
72539+
if (it.explicitKey) {
7250272540
if (!it.sep) {
7250372541
if (includesToken(it.start, 'newline')) {
7250472542
Object.assign(it, { key: null, sep: [this.sourceToken] });
@@ -72589,9 +72627,7 @@ class Parser {
7258972627
default: {
7259072628
const bv = this.startBlockValue(map);
7259172629
if (bv) {
72592-
if (atNextItem &&
72593-
bv.type !== 'block-seq' &&
72594-
includesToken(it.start, 'explicit-key-ind')) {
72630+
if (atMapIndent && bv.type !== 'block-seq') {
7259572631
map.items.push({ start });
7259672632
}
7259772633
this.stack.push(bv);
@@ -72812,7 +72848,7 @@ class Parser {
7281272848
type: 'block-map',
7281372849
offset: this.offset,
7281472850
indent: this.indent,
72815-
items: [{ start }]
72851+
items: [{ start, explicitKey: true }]
7281672852
};
7281772853
}
7281872854
case 'map-value-ind': {

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@actions/core": "^1.10.1",
2929
"@aws-sdk/client-codedeploy": "^3.592.0",
3030
"@aws-sdk/client-ecs": "^3.583.0",
31-
"yaml": "^2.4.3"
31+
"yaml": "^2.4.5"
3232
},
3333
"devDependencies": {
3434
"@eslint/js": "^9.3.0",

0 commit comments

Comments
 (0)