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:
2
node_modules/yaml/dist/stringify/foldFlowLines.d.ts
generated
vendored
2
node_modules/yaml/dist/stringify/foldFlowLines.d.ts
generated
vendored
@@ -5,7 +5,7 @@ export declare const FOLD_QUOTED = "quoted";
|
||||
* `'block'` prevents more-indented lines from being folded;
|
||||
* `'quoted'` allows for `\` escapes, including escaped newlines
|
||||
*/
|
||||
export declare type FoldMode = 'flow' | 'block' | 'quoted';
|
||||
export type FoldMode = 'flow' | 'block' | 'quoted';
|
||||
export interface FoldOptions {
|
||||
/**
|
||||
* Accounts for leading contents on the first line, defaulting to
|
||||
|
||||
3
node_modules/yaml/dist/stringify/stringify.d.ts
generated
vendored
3
node_modules/yaml/dist/stringify/stringify.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
import type { Document } from '../doc/Document.js';
|
||||
import type { Alias } from '../nodes/Alias.js';
|
||||
import type { ToStringOptions } from '../options.js';
|
||||
export declare type StringifyContext = {
|
||||
export type StringifyContext = {
|
||||
actualString?: boolean;
|
||||
allNullValues?: boolean;
|
||||
anchors: Set<string>;
|
||||
@@ -13,6 +13,7 @@ export declare type StringifyContext = {
|
||||
indentAtStart?: number;
|
||||
inFlow: boolean | null;
|
||||
inStringifyKey?: boolean;
|
||||
flowCollectionPadding: string;
|
||||
options: Readonly<Required<Omit<ToStringOptions, 'collectionStyle' | 'indent'>>>;
|
||||
resolvedAliases?: Set<Alias>;
|
||||
};
|
||||
|
||||
18
node_modules/yaml/dist/stringify/stringify.js
generated
vendored
18
node_modules/yaml/dist/stringify/stringify.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var anchors = require('../doc/anchors.js');
|
||||
var Node = require('../nodes/Node.js');
|
||||
var identity = require('../nodes/identity.js');
|
||||
var stringifyComment = require('./stringifyComment.js');
|
||||
var stringifyString = require('./stringifyString.js');
|
||||
|
||||
@@ -15,6 +15,7 @@ function createStringifyContext(doc, options) {
|
||||
doubleQuotedAsJSON: false,
|
||||
doubleQuotedMinMultiLineLength: 40,
|
||||
falseStr: 'false',
|
||||
flowCollectionPadding: true,
|
||||
indentSeq: true,
|
||||
lineWidth: 80,
|
||||
minContentWidth: 20,
|
||||
@@ -38,6 +39,7 @@ function createStringifyContext(doc, options) {
|
||||
return {
|
||||
anchors: new Set(),
|
||||
doc,
|
||||
flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',
|
||||
indent: '',
|
||||
indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ',
|
||||
inFlow,
|
||||
@@ -52,7 +54,7 @@ function getTagObject(tags, item) {
|
||||
}
|
||||
let tagObj = undefined;
|
||||
let obj;
|
||||
if (Node.isScalar(item)) {
|
||||
if (identity.isScalar(item)) {
|
||||
obj = item.value;
|
||||
const match = tags.filter(t => t.identify?.(obj));
|
||||
tagObj =
|
||||
@@ -73,7 +75,7 @@ function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
|
||||
if (!doc.directives)
|
||||
return '';
|
||||
const props = [];
|
||||
const anchor = (Node.isScalar(node) || Node.isCollection(node)) && node.anchor;
|
||||
const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
|
||||
if (anchor && anchors.anchorIsValid(anchor)) {
|
||||
anchors$1.add(anchor);
|
||||
props.push(`&${anchor}`);
|
||||
@@ -84,9 +86,9 @@ function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
|
||||
return props.join(' ');
|
||||
}
|
||||
function stringify(item, ctx, onComment, onChompKeep) {
|
||||
if (Node.isPair(item))
|
||||
if (identity.isPair(item))
|
||||
return item.toString(ctx, onComment, onChompKeep);
|
||||
if (Node.isAlias(item)) {
|
||||
if (identity.isAlias(item)) {
|
||||
if (ctx.doc.directives)
|
||||
return item.toString(ctx);
|
||||
if (ctx.resolvedAliases?.has(item)) {
|
||||
@@ -101,7 +103,7 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
||||
}
|
||||
}
|
||||
let tagObj = undefined;
|
||||
const node = Node.isNode(item)
|
||||
const node = identity.isNode(item)
|
||||
? item
|
||||
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
||||
if (!tagObj)
|
||||
@@ -111,12 +113,12 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
||||
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
||||
const str = typeof tagObj.stringify === 'function'
|
||||
? tagObj.stringify(node, ctx, onComment, onChompKeep)
|
||||
: Node.isScalar(node)
|
||||
: identity.isScalar(node)
|
||||
? stringifyString.stringifyString(node, ctx, onComment, onChompKeep)
|
||||
: node.toString(ctx, onComment, onChompKeep);
|
||||
if (!props)
|
||||
return str;
|
||||
return Node.isScalar(node) || str[0] === '{' || str[0] === '['
|
||||
return identity.isScalar(node) || str[0] === '{' || str[0] === '['
|
||||
? `${props} ${str}`
|
||||
: `${props}\n${ctx.indent}${str}`;
|
||||
}
|
||||
|
||||
24
node_modules/yaml/dist/stringify/stringifyCollection.js
generated
vendored
24
node_modules/yaml/dist/stringify/stringifyCollection.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var Collection = require('../nodes/Collection.js');
|
||||
var Node = require('../nodes/Node.js');
|
||||
var identity = require('../nodes/identity.js');
|
||||
var stringify = require('./stringify.js');
|
||||
var stringifyComment = require('./stringifyComment.js');
|
||||
|
||||
@@ -18,15 +18,15 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
|
||||
for (let i = 0; i < items.length; ++i) {
|
||||
const item = items[i];
|
||||
let comment = null;
|
||||
if (Node.isNode(item)) {
|
||||
if (identity.isNode(item)) {
|
||||
if (!chompKeep && item.spaceBefore)
|
||||
lines.push('');
|
||||
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
||||
if (item.comment)
|
||||
comment = item.comment;
|
||||
}
|
||||
else if (Node.isPair(item)) {
|
||||
const ik = Node.isNode(item.key) ? item.key : null;
|
||||
else if (identity.isPair(item)) {
|
||||
const ik = identity.isNode(item.key) ? item.key : null;
|
||||
if (ik) {
|
||||
if (!chompKeep && ik.spaceBefore)
|
||||
lines.push('');
|
||||
@@ -62,7 +62,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
|
||||
return str;
|
||||
}
|
||||
function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) {
|
||||
const { indent, indentStep, options: { commentString } } = ctx;
|
||||
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
|
||||
itemIndent += indentStep;
|
||||
const itemCtx = Object.assign({}, ctx, {
|
||||
indent: itemIndent,
|
||||
@@ -75,15 +75,15 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
|
||||
for (let i = 0; i < items.length; ++i) {
|
||||
const item = items[i];
|
||||
let comment = null;
|
||||
if (Node.isNode(item)) {
|
||||
if (identity.isNode(item)) {
|
||||
if (item.spaceBefore)
|
||||
lines.push('');
|
||||
addCommentBefore(ctx, lines, item.commentBefore, false);
|
||||
if (item.comment)
|
||||
comment = item.comment;
|
||||
}
|
||||
else if (Node.isPair(item)) {
|
||||
const ik = Node.isNode(item.key) ? item.key : null;
|
||||
else if (identity.isPair(item)) {
|
||||
const ik = identity.isNode(item.key) ? item.key : null;
|
||||
if (ik) {
|
||||
if (ik.spaceBefore)
|
||||
lines.push('');
|
||||
@@ -91,14 +91,14 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
|
||||
if (ik.comment)
|
||||
reqNewline = true;
|
||||
}
|
||||
const iv = Node.isNode(item.value) ? item.value : null;
|
||||
const iv = identity.isNode(item.value) ? item.value : null;
|
||||
if (iv) {
|
||||
if (iv.comment)
|
||||
comment = iv.comment;
|
||||
if (iv.commentBefore)
|
||||
reqNewline = true;
|
||||
}
|
||||
else if (item.value == null && ik && ik.comment) {
|
||||
else if (item.value == null && ik?.comment) {
|
||||
comment = ik.comment;
|
||||
}
|
||||
}
|
||||
@@ -131,11 +131,11 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
|
||||
str += `\n${indent}${end}`;
|
||||
}
|
||||
else {
|
||||
str = `${start} ${lines.join(' ')} ${end}`;
|
||||
str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
|
||||
}
|
||||
}
|
||||
if (comment) {
|
||||
str += stringifyComment.lineComment(str, commentString(comment), indent);
|
||||
str += stringifyComment.lineComment(str, indent, commentString(comment));
|
||||
if (onComment)
|
||||
onComment();
|
||||
}
|
||||
|
||||
7
node_modules/yaml/dist/stringify/stringifyDocument.d.ts
generated
vendored
7
node_modules/yaml/dist/stringify/stringifyDocument.d.ts
generated
vendored
@@ -1,3 +1,4 @@
|
||||
import { Document } from '../doc/Document.js';
|
||||
import { ToStringOptions } from '../options.js';
|
||||
export declare function stringifyDocument(doc: Readonly<Document>, options: ToStringOptions): string;
|
||||
import type { Document } from '../doc/Document.js';
|
||||
import type { Node } from '../nodes/Node.js';
|
||||
import type { ToStringOptions } from '../options.js';
|
||||
export declare function stringifyDocument(doc: Readonly<Document<Node, boolean>>, options: ToStringOptions): string;
|
||||
|
||||
4
node_modules/yaml/dist/stringify/stringifyDocument.js
generated
vendored
4
node_modules/yaml/dist/stringify/stringifyDocument.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var Node = require('../nodes/Node.js');
|
||||
var identity = require('../nodes/identity.js');
|
||||
var stringify = require('./stringify.js');
|
||||
var stringifyComment = require('./stringifyComment.js');
|
||||
|
||||
@@ -29,7 +29,7 @@ function stringifyDocument(doc, options) {
|
||||
let chompKeep = false;
|
||||
let contentComment = null;
|
||||
if (doc.contents) {
|
||||
if (Node.isNode(doc.contents)) {
|
||||
if (identity.isNode(doc.contents)) {
|
||||
if (doc.contents.spaceBefore && hasDirectives)
|
||||
lines.push('');
|
||||
if (doc.contents.commentBefore) {
|
||||
|
||||
83
node_modules/yaml/dist/stringify/stringifyPair.js
generated
vendored
83
node_modules/yaml/dist/stringify/stringifyPair.js
generated
vendored
@@ -1,18 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var Node = require('../nodes/Node.js');
|
||||
var identity = require('../nodes/identity.js');
|
||||
var Scalar = require('../nodes/Scalar.js');
|
||||
var stringify = require('./stringify.js');
|
||||
var stringifyComment = require('./stringifyComment.js');
|
||||
|
||||
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
||||
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
||||
let keyComment = (Node.isNode(key) && key.comment) || null;
|
||||
let keyComment = (identity.isNode(key) && key.comment) || null;
|
||||
if (simpleKeys) {
|
||||
if (keyComment) {
|
||||
throw new Error('With simple keys, key nodes cannot have comments');
|
||||
}
|
||||
if (Node.isCollection(key)) {
|
||||
if (identity.isCollection(key)) {
|
||||
const msg = 'With simple keys, collection cannot be used as a key value';
|
||||
throw new Error(msg);
|
||||
}
|
||||
@@ -20,8 +20,8 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
||||
let explicitKey = !simpleKeys &&
|
||||
(!key ||
|
||||
(keyComment && value == null && !ctx.inFlow) ||
|
||||
Node.isCollection(key) ||
|
||||
(Node.isScalar(key)
|
||||
identity.isCollection(key) ||
|
||||
(identity.isScalar(key)
|
||||
? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL
|
||||
: typeof key === 'object'));
|
||||
ctx = Object.assign({}, ctx, {
|
||||
@@ -65,51 +65,76 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
||||
if (keyComment)
|
||||
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
|
||||
}
|
||||
let vcb = '';
|
||||
let valueComment = null;
|
||||
if (Node.isNode(value)) {
|
||||
if (value.spaceBefore)
|
||||
vcb = '\n';
|
||||
if (value.commentBefore) {
|
||||
const cs = commentString(value.commentBefore);
|
||||
vcb += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
|
||||
}
|
||||
let vsb, vcb, valueComment;
|
||||
if (identity.isNode(value)) {
|
||||
vsb = !!value.spaceBefore;
|
||||
vcb = value.commentBefore;
|
||||
valueComment = value.comment;
|
||||
}
|
||||
else if (value && typeof value === 'object') {
|
||||
value = doc.createNode(value);
|
||||
else {
|
||||
vsb = false;
|
||||
vcb = null;
|
||||
valueComment = null;
|
||||
if (value && typeof value === 'object')
|
||||
value = doc.createNode(value);
|
||||
}
|
||||
ctx.implicitKey = false;
|
||||
if (!explicitKey && !keyComment && Node.isScalar(value))
|
||||
if (!explicitKey && !keyComment && identity.isScalar(value))
|
||||
ctx.indentAtStart = str.length + 1;
|
||||
chompKeep = false;
|
||||
if (!indentSeq &&
|
||||
indentStep.length >= 2 &&
|
||||
!ctx.inFlow &&
|
||||
!explicitKey &&
|
||||
Node.isSeq(value) &&
|
||||
identity.isSeq(value) &&
|
||||
!value.flow &&
|
||||
!value.tag &&
|
||||
!value.anchor) {
|
||||
// If indentSeq === false, consider '- ' as part of indentation where possible
|
||||
ctx.indent = ctx.indent.substr(2);
|
||||
ctx.indent = ctx.indent.substring(2);
|
||||
}
|
||||
let valueCommentDone = false;
|
||||
const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
|
||||
let ws = ' ';
|
||||
if (vcb || keyComment) {
|
||||
if (valueStr === '' && !ctx.inFlow)
|
||||
ws = vcb === '\n' ? '\n\n' : vcb;
|
||||
else
|
||||
ws = `${vcb}\n${ctx.indent}`;
|
||||
if (keyComment || vsb || vcb) {
|
||||
ws = vsb ? '\n' : '';
|
||||
if (vcb) {
|
||||
const cs = commentString(vcb);
|
||||
ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
|
||||
}
|
||||
if (valueStr === '' && !ctx.inFlow) {
|
||||
if (ws === '\n')
|
||||
ws = '\n\n';
|
||||
}
|
||||
else {
|
||||
ws += `\n${ctx.indent}`;
|
||||
}
|
||||
}
|
||||
else if (!explicitKey && Node.isCollection(value)) {
|
||||
const flow = valueStr[0] === '[' || valueStr[0] === '{';
|
||||
if (!flow || valueStr.includes('\n'))
|
||||
ws = `\n${ctx.indent}`;
|
||||
else if (!explicitKey && identity.isCollection(value)) {
|
||||
const vs0 = valueStr[0];
|
||||
const nl0 = valueStr.indexOf('\n');
|
||||
const hasNewline = nl0 !== -1;
|
||||
const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
|
||||
if (hasNewline || !flow) {
|
||||
let hasPropsLine = false;
|
||||
if (hasNewline && (vs0 === '&' || vs0 === '!')) {
|
||||
let sp0 = valueStr.indexOf(' ');
|
||||
if (vs0 === '&' &&
|
||||
sp0 !== -1 &&
|
||||
sp0 < nl0 &&
|
||||
valueStr[sp0 + 1] === '!') {
|
||||
sp0 = valueStr.indexOf(' ', sp0 + 1);
|
||||
}
|
||||
if (sp0 === -1 || nl0 < sp0)
|
||||
hasPropsLine = true;
|
||||
}
|
||||
if (!hasPropsLine)
|
||||
ws = `\n${ctx.indent}`;
|
||||
}
|
||||
}
|
||||
else if (valueStr === '' || valueStr[0] === '\n')
|
||||
else if (valueStr === '' || valueStr[0] === '\n') {
|
||||
ws = '';
|
||||
}
|
||||
str += ws + valueStr;
|
||||
if (ctx.inFlow) {
|
||||
if (valueCommentDone && onComment)
|
||||
|
||||
8
node_modules/yaml/dist/stringify/stringifyString.d.ts
generated
vendored
8
node_modules/yaml/dist/stringify/stringifyString.d.ts
generated
vendored
@@ -1,3 +1,9 @@
|
||||
import { Scalar } from '../nodes/Scalar.js';
|
||||
import type { StringifyContext } from './stringify.js';
|
||||
export declare function stringifyString(item: Scalar, ctx: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
|
||||
interface StringifyScalar {
|
||||
value: string;
|
||||
comment?: string | null;
|
||||
type?: string;
|
||||
}
|
||||
export declare function stringifyString(item: Scalar | StringifyScalar, ctx: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
|
||||
export {};
|
||||
|
||||
38
node_modules/yaml/dist/stringify/stringifyString.js
generated
vendored
38
node_modules/yaml/dist/stringify/stringifyString.js
generated
vendored
@@ -3,8 +3,8 @@
|
||||
var Scalar = require('../nodes/Scalar.js');
|
||||
var foldFlowLines = require('./foldFlowLines.js');
|
||||
|
||||
const getFoldOptions = (ctx) => ({
|
||||
indentAtStart: ctx.indentAtStart,
|
||||
const getFoldOptions = (ctx, isBlock) => ({
|
||||
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
||||
lineWidth: ctx.options.lineWidth,
|
||||
minContentWidth: ctx.options.minContentWidth
|
||||
});
|
||||
@@ -117,7 +117,7 @@ function doubleQuotedString(value, ctx) {
|
||||
str = start ? str + json.slice(start) : json;
|
||||
return implicitKey
|
||||
? str
|
||||
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx));
|
||||
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
||||
}
|
||||
function singleQuotedString(value, ctx) {
|
||||
if (ctx.options.singleQuote === false ||
|
||||
@@ -129,7 +129,7 @@ function singleQuotedString(value, ctx) {
|
||||
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
||||
return ctx.implicitKey
|
||||
? res
|
||||
: foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
|
||||
: foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
||||
}
|
||||
function quotedString(value, ctx) {
|
||||
const { singleQuote } = ctx.options;
|
||||
@@ -148,6 +148,15 @@ function quotedString(value, ctx) {
|
||||
}
|
||||
return qs(value, ctx);
|
||||
}
|
||||
// The negative lookbehind avoids a polynomial search,
|
||||
// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind
|
||||
let blockEndNewlines;
|
||||
try {
|
||||
blockEndNewlines = new RegExp('(^|(?<!\n))\n+(?!\n|$)', 'g');
|
||||
}
|
||||
catch {
|
||||
blockEndNewlines = /\n+(?!\n|$)/g;
|
||||
}
|
||||
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
||||
const { blockQuote, commentString, lineWidth } = ctx.options;
|
||||
// 1. Block can't end in whitespace unless the last line is non-empty.
|
||||
@@ -191,7 +200,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
||||
value = value.slice(0, -end.length);
|
||||
if (end[end.length - 1] === '\n')
|
||||
end = end.slice(0, -1);
|
||||
end = end.replace(/\n+(?!\n|$)/g, `$&${indent}`);
|
||||
end = end.replace(blockEndNewlines, `$&${indent}`);
|
||||
}
|
||||
// determine indent indicator from whitespace at value start
|
||||
let startWithSpace = false;
|
||||
@@ -227,13 +236,13 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
||||
.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));
|
||||
const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
|
||||
return `${header}\n${indent}${body}`;
|
||||
}
|
||||
function plainString(item, ctx, onComment, onChompKeep) {
|
||||
const { type, value } = item;
|
||||
const { actualString, implicitKey, indent, inFlow } = ctx;
|
||||
if ((implicitKey && /[\n[\]{},]/.test(value)) ||
|
||||
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
||||
if ((implicitKey && value.includes('\n')) ||
|
||||
(inFlow && /[[\]{},]/.test(value))) {
|
||||
return quotedString(value, ctx);
|
||||
}
|
||||
@@ -256,9 +265,14 @@ function plainString(item, ctx, onComment, onChompKeep) {
|
||||
// Where allowed & type not set explicitly, prefer block style for multiline strings
|
||||
return blockString(item, ctx, onComment, onChompKeep);
|
||||
}
|
||||
if (indent === '' && containsDocumentMarker(value)) {
|
||||
ctx.forceBlockIndent = true;
|
||||
return blockString(item, ctx, onComment, onChompKeep);
|
||||
if (containsDocumentMarker(value)) {
|
||||
if (indent === '') {
|
||||
ctx.forceBlockIndent = true;
|
||||
return blockString(item, ctx, onComment, onChompKeep);
|
||||
}
|
||||
else if (implicitKey && indent === indentStep) {
|
||||
return quotedString(value, ctx);
|
||||
}
|
||||
}
|
||||
const str = value.replace(/\n+/g, `$&\n${indent}`);
|
||||
// Verify that output will be parsed as a string, as e.g. plain numbers and
|
||||
@@ -272,7 +286,7 @@ function plainString(item, ctx, onComment, onChompKeep) {
|
||||
}
|
||||
return implicitKey
|
||||
? str
|
||||
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
|
||||
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
||||
}
|
||||
function stringifyString(item, ctx, onComment, onChompKeep) {
|
||||
const { implicitKey, inFlow } = ctx;
|
||||
|
||||
Reference in New Issue
Block a user