mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-12-09 22:30:41 -07:00
node_modules: upgrade
This commit is contained in:
42
node_modules/yaml/dist/compose/resolve-props.js
generated
vendored
42
node_modules/yaml/dist/compose/resolve-props.js
generated
vendored
@@ -1,16 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) {
|
||||
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
||||
let spaceBefore = false;
|
||||
let atNewline = startOnNewline;
|
||||
let hasSpace = startOnNewline;
|
||||
let comment = '';
|
||||
let commentSep = '';
|
||||
let hasNewline = false;
|
||||
let hasNewlineAfterProp = false;
|
||||
let reqSpace = false;
|
||||
let tab = null;
|
||||
let anchor = null;
|
||||
let tag = null;
|
||||
let newlineAfterProp = null;
|
||||
let comma = null;
|
||||
let found = null;
|
||||
let start = null;
|
||||
@@ -22,16 +23,22 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
|
||||
reqSpace = false;
|
||||
}
|
||||
if (tab) {
|
||||
if (atNewline && token.type !== 'comment' && token.type !== 'newline') {
|
||||
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
|
||||
}
|
||||
tab = null;
|
||||
}
|
||||
switch (token.type) {
|
||||
case 'space':
|
||||
// At the doc level, tabs at line start may be parsed
|
||||
// as leading white space rather than indentation.
|
||||
// In a flow collection, only the parser handles indent.
|
||||
if (!flow &&
|
||||
atNewline &&
|
||||
indicator !== 'doc-start' &&
|
||||
token.source[0] === '\t')
|
||||
onError(token, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
|
||||
(indicator !== 'doc-start' || next?.type !== 'flow-collection') &&
|
||||
token.source.includes('\t')) {
|
||||
tab = token;
|
||||
}
|
||||
hasSpace = true;
|
||||
break;
|
||||
case 'comment': {
|
||||
@@ -50,7 +57,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
if (atNewline) {
|
||||
if (comment)
|
||||
comment += token.source;
|
||||
else
|
||||
else if (!found || indicator !== 'seq-item-ind')
|
||||
spaceBefore = true;
|
||||
}
|
||||
else
|
||||
@@ -58,7 +65,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
atNewline = true;
|
||||
hasNewline = true;
|
||||
if (anchor || tag)
|
||||
hasNewlineAfterProp = true;
|
||||
newlineAfterProp = token;
|
||||
hasSpace = true;
|
||||
break;
|
||||
case 'anchor':
|
||||
@@ -67,8 +74,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
if (token.source.endsWith(':'))
|
||||
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
||||
anchor = token;
|
||||
if (start === null)
|
||||
start = token.offset;
|
||||
start ?? (start = token.offset);
|
||||
atNewline = false;
|
||||
hasSpace = false;
|
||||
reqSpace = true;
|
||||
@@ -77,8 +83,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
if (tag)
|
||||
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
||||
tag = token;
|
||||
if (start === null)
|
||||
start = token.offset;
|
||||
start ?? (start = token.offset);
|
||||
atNewline = false;
|
||||
hasSpace = false;
|
||||
reqSpace = true;
|
||||
@@ -91,7 +96,8 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
if (found)
|
||||
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);
|
||||
found = token;
|
||||
atNewline = false;
|
||||
atNewline =
|
||||
indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';
|
||||
hasSpace = false;
|
||||
break;
|
||||
case 'comma':
|
||||
@@ -117,17 +123,23 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
||||
next.type !== 'space' &&
|
||||
next.type !== 'newline' &&
|
||||
next.type !== 'comma' &&
|
||||
(next.type !== 'scalar' || next.source !== ''))
|
||||
(next.type !== 'scalar' || next.source !== '')) {
|
||||
onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
|
||||
}
|
||||
if (tab &&
|
||||
((atNewline && tab.indent <= parentIndent) ||
|
||||
next?.type === 'block-map' ||
|
||||
next?.type === 'block-seq'))
|
||||
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
|
||||
return {
|
||||
comma,
|
||||
found,
|
||||
spaceBefore,
|
||||
comment,
|
||||
hasNewline,
|
||||
hasNewlineAfterProp,
|
||||
anchor,
|
||||
tag,
|
||||
newlineAfterProp,
|
||||
end,
|
||||
start: start ?? end
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user