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:
36
node_modules/yaml/dist/stringify/stringifyString.js
generated
vendored
36
node_modules/yaml/dist/stringify/stringifyString.js
generated
vendored
@@ -221,23 +221,32 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
||||
start = start.replace(/\n+/g, `$&${indent}`);
|
||||
}
|
||||
const indentSize = indent ? '2' : '1'; // root is at -1
|
||||
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
||||
// Leading | or > is added later
|
||||
let header = (startWithSpace ? indentSize : '') + chomp;
|
||||
if (comment) {
|
||||
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
||||
if (onComment)
|
||||
onComment();
|
||||
}
|
||||
if (literal) {
|
||||
value = value.replace(/\n+/g, `$&${indent}`);
|
||||
return `${header}\n${indent}${start}${value}${end}`;
|
||||
if (!literal) {
|
||||
const foldedValue = value
|
||||
.replace(/\n+/g, '\n$&')
|
||||
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
||||
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
||||
.replace(/\n+/g, `$&${indent}`);
|
||||
let literalFallback = false;
|
||||
const foldOptions = getFoldOptions(ctx, true);
|
||||
if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {
|
||||
foldOptions.onOverflow = () => {
|
||||
literalFallback = true;
|
||||
};
|
||||
}
|
||||
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
|
||||
if (!literalFallback)
|
||||
return `>${header}\n${indent}${body}`;
|
||||
}
|
||||
value = value
|
||||
.replace(/\n+/g, '\n$&')
|
||||
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
||||
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
||||
.replace(/\n+/g, `$&${indent}`);
|
||||
const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
|
||||
return `${header}\n${indent}${body}`;
|
||||
value = value.replace(/\n+/g, `$&${indent}`);
|
||||
return `|${header}\n${indent}${start}${value}${end}`;
|
||||
}
|
||||
function plainString(item, ctx, onComment, onChompKeep) {
|
||||
const { type, value } = item;
|
||||
@@ -246,10 +255,9 @@ function plainString(item, ctx, onComment, onChompKeep) {
|
||||
(inFlow && /[[\]{},]/.test(value))) {
|
||||
return quotedString(value, ctx);
|
||||
}
|
||||
if (!value ||
|
||||
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
||||
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
||||
// not allowed:
|
||||
// - empty string, '-' or '?'
|
||||
// - '-' or '?'
|
||||
// - start with an indicator character (except [?:-]) or /[?-] /
|
||||
// - '\n ', ': ' or ' \n' anywhere
|
||||
// - '#' not preceded by a non-space char
|
||||
|
||||
Reference in New Issue
Block a user