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:
31
node_modules/yaml/dist/stringify/foldFlowLines.js
generated
vendored
31
node_modules/yaml/dist/stringify/foldFlowLines.js
generated
vendored
@@ -11,6 +11,8 @@ const FOLD_QUOTED = 'quoted';
|
||||
function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
||||
if (!lineWidth || lineWidth < 0)
|
||||
return text;
|
||||
if (lineWidth < minContentWidth)
|
||||
minContentWidth = 0;
|
||||
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
|
||||
if (text.length <= endStep)
|
||||
return text;
|
||||
@@ -30,7 +32,7 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
|
||||
let escStart = -1;
|
||||
let escEnd = -1;
|
||||
if (mode === FOLD_BLOCK) {
|
||||
i = consumeMoreIndentedLines(text, i);
|
||||
i = consumeMoreIndentedLines(text, i, indent.length);
|
||||
if (i !== -1)
|
||||
end = i + endStep;
|
||||
}
|
||||
@@ -54,8 +56,8 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
|
||||
}
|
||||
if (ch === '\n') {
|
||||
if (mode === FOLD_BLOCK)
|
||||
i = consumeMoreIndentedLines(text, i);
|
||||
end = i + endStep;
|
||||
i = consumeMoreIndentedLines(text, i, indent.length);
|
||||
end = i + indent.length + endStep;
|
||||
split = undefined;
|
||||
}
|
||||
else {
|
||||
@@ -123,15 +125,24 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
|
||||
* Presumes `i + 1` is at the start of a line
|
||||
* @returns index of last newline in more-indented block
|
||||
*/
|
||||
function consumeMoreIndentedLines(text, i) {
|
||||
let ch = text[i + 1];
|
||||
function consumeMoreIndentedLines(text, i, indent) {
|
||||
let end = i;
|
||||
let start = i + 1;
|
||||
let ch = text[start];
|
||||
while (ch === ' ' || ch === '\t') {
|
||||
do {
|
||||
ch = text[(i += 1)];
|
||||
} while (ch && ch !== '\n');
|
||||
ch = text[i + 1];
|
||||
if (i < start + indent) {
|
||||
ch = text[++i];
|
||||
}
|
||||
else {
|
||||
do {
|
||||
ch = text[++i];
|
||||
} while (ch && ch !== '\n');
|
||||
end = i;
|
||||
start = i + 1;
|
||||
ch = text[start];
|
||||
}
|
||||
}
|
||||
return i;
|
||||
return end;
|
||||
}
|
||||
|
||||
exports.FOLD_BLOCK = FOLD_BLOCK;
|
||||
|
||||
Reference in New Issue
Block a user