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;
|
||||
|
||||
6
node_modules/yaml/dist/stringify/stringify.d.ts
generated
vendored
6
node_modules/yaml/dist/stringify/stringify.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import type { Document } from '../doc/Document.js';
|
||||
import type { Alias } from '../nodes/Alias.js';
|
||||
import type { ToStringOptions } from '../options.js';
|
||||
import type { Document } from '../doc/Document';
|
||||
import type { Alias } from '../nodes/Alias';
|
||||
import type { ToStringOptions } from '../options';
|
||||
export type StringifyContext = {
|
||||
actualString?: boolean;
|
||||
allNullValues?: boolean;
|
||||
|
||||
14
node_modules/yaml/dist/stringify/stringify.js
generated
vendored
14
node_modules/yaml/dist/stringify/stringify.js
generated
vendored
@@ -56,7 +56,12 @@ function getTagObject(tags, item) {
|
||||
let obj;
|
||||
if (identity.isScalar(item)) {
|
||||
obj = item.value;
|
||||
const match = tags.filter(t => t.identify?.(obj));
|
||||
let match = tags.filter(t => t.identify?.(obj));
|
||||
if (match.length > 1) {
|
||||
const testMatch = match.filter(t => t.test);
|
||||
if (testMatch.length > 0)
|
||||
match = testMatch;
|
||||
}
|
||||
tagObj =
|
||||
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
||||
}
|
||||
@@ -65,7 +70,7 @@ function getTagObject(tags, item) {
|
||||
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
||||
}
|
||||
if (!tagObj) {
|
||||
const name = obj?.constructor?.name ?? typeof obj;
|
||||
const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
|
||||
throw new Error(`Tag not resolved for ${name} value`);
|
||||
}
|
||||
return tagObj;
|
||||
@@ -80,7 +85,7 @@ function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
|
||||
anchors$1.add(anchor);
|
||||
props.push(`&${anchor}`);
|
||||
}
|
||||
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
||||
const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
|
||||
if (tag)
|
||||
props.push(doc.directives.tagString(tag));
|
||||
return props.join(' ');
|
||||
@@ -106,8 +111,7 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
||||
const node = identity.isNode(item)
|
||||
? item
|
||||
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
||||
if (!tagObj)
|
||||
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
||||
tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
|
||||
const props = stringifyProps(node, tagObj, ctx);
|
||||
if (props.length > 0)
|
||||
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
||||
|
||||
4
node_modules/yaml/dist/stringify/stringifyCollection.d.ts
generated
vendored
4
node_modules/yaml/dist/stringify/stringifyCollection.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Collection } from '../nodes/Collection.js';
|
||||
import { StringifyContext } from './stringify.js';
|
||||
import type { Collection } from '../nodes/Collection';
|
||||
import type { StringifyContext } from './stringify';
|
||||
interface StringifyCollectionOptions {
|
||||
blockItemPrefix: string;
|
||||
flowChars: {
|
||||
|
||||
20
node_modules/yaml/dist/stringify/stringifyCollection.js
generated
vendored
20
node_modules/yaml/dist/stringify/stringifyCollection.js
generated
vendored
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var Collection = require('../nodes/Collection.js');
|
||||
var identity = require('../nodes/identity.js');
|
||||
var stringify = require('./stringify.js');
|
||||
var stringifyComment = require('./stringifyComment.js');
|
||||
@@ -61,7 +60,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
|
||||
onChompKeep();
|
||||
return str;
|
||||
}
|
||||
function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) {
|
||||
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
|
||||
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
|
||||
itemIndent += indentStep;
|
||||
const itemCtx = Object.assign({}, ctx, {
|
||||
@@ -114,32 +113,25 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
|
||||
lines.push(str);
|
||||
linesAtValue = lines.length;
|
||||
}
|
||||
let str;
|
||||
const { start, end } = flowChars;
|
||||
if (lines.length === 0) {
|
||||
str = start + end;
|
||||
return start + end;
|
||||
}
|
||||
else {
|
||||
if (!reqNewline) {
|
||||
const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
|
||||
reqNewline = len > Collection.Collection.maxFlowStringSingleLineLength;
|
||||
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
|
||||
}
|
||||
if (reqNewline) {
|
||||
str = start;
|
||||
let str = start;
|
||||
for (const line of lines)
|
||||
str += line ? `\n${indentStep}${indent}${line}` : '\n';
|
||||
str += `\n${indent}${end}`;
|
||||
return `${str}\n${indent}${end}`;
|
||||
}
|
||||
else {
|
||||
str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
|
||||
return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
|
||||
}
|
||||
}
|
||||
if (comment) {
|
||||
str += stringifyComment.lineComment(str, indent, commentString(comment));
|
||||
if (onComment)
|
||||
onComment();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
|
||||
if (comment && chompKeep)
|
||||
|
||||
6
node_modules/yaml/dist/stringify/stringifyDocument.d.ts
generated
vendored
6
node_modules/yaml/dist/stringify/stringifyDocument.d.ts
generated
vendored
@@ -1,4 +1,4 @@
|
||||
import type { Document } from '../doc/Document.js';
|
||||
import type { Node } from '../nodes/Node.js';
|
||||
import type { ToStringOptions } from '../options.js';
|
||||
import type { Document } from '../doc/Document';
|
||||
import type { Node } from '../nodes/Node';
|
||||
import type { ToStringOptions } from '../options';
|
||||
export declare function stringifyDocument(doc: Readonly<Document<Node, boolean>>, options: ToStringOptions): string;
|
||||
|
||||
2
node_modules/yaml/dist/stringify/stringifyNumber.d.ts
generated
vendored
2
node_modules/yaml/dist/stringify/stringifyNumber.d.ts
generated
vendored
@@ -1,2 +1,2 @@
|
||||
import type { Scalar } from '../nodes/Scalar.js';
|
||||
import type { Scalar } from '../nodes/Scalar';
|
||||
export declare function stringifyNumber({ format, minFractionDigits, tag, value }: Scalar): string;
|
||||
|
||||
4
node_modules/yaml/dist/stringify/stringifyPair.d.ts
generated
vendored
4
node_modules/yaml/dist/stringify/stringifyPair.d.ts
generated
vendored
@@ -1,3 +1,3 @@
|
||||
import type { Pair } from '../nodes/Pair.js';
|
||||
import { StringifyContext } from './stringify.js';
|
||||
import type { Pair } from '../nodes/Pair';
|
||||
import type { StringifyContext } from './stringify';
|
||||
export declare function stringifyPair({ key, value }: Readonly<Pair>, ctx: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
|
||||
|
||||
2
node_modules/yaml/dist/stringify/stringifyPair.js
generated
vendored
2
node_modules/yaml/dist/stringify/stringifyPair.js
generated
vendored
@@ -12,7 +12,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
||||
if (keyComment) {
|
||||
throw new Error('With simple keys, key nodes cannot have comments');
|
||||
}
|
||||
if (identity.isCollection(key)) {
|
||||
if (identity.isCollection(key) || (!identity.isNode(key) && typeof key === 'object')) {
|
||||
const msg = 'With simple keys, collection cannot be used as a key value';
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
4
node_modules/yaml/dist/stringify/stringifyString.d.ts
generated
vendored
4
node_modules/yaml/dist/stringify/stringifyString.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Scalar } from '../nodes/Scalar.js';
|
||||
import type { StringifyContext } from './stringify.js';
|
||||
import { Scalar } from '../nodes/Scalar';
|
||||
import type { StringifyContext } from './stringify';
|
||||
interface StringifyScalar {
|
||||
value: string;
|
||||
comment?: string | null;
|
||||
|
||||
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