run npm ci && npm run build

This commit is contained in:
Jeff Widman
2023-01-02 19:16:14 +00:00
parent 1fb40167bd
commit a00355d0b5

96
dist/index.js generated vendored
View File

@@ -13569,13 +13569,13 @@ function findPair(items, key) {
return undefined; return undefined;
} }
class YAMLMap extends Collection.Collection { class YAMLMap extends Collection.Collection {
static get tagName() {
return 'tag:yaml.org,2002:map';
}
constructor(schema) { constructor(schema) {
super(Node.MAP, schema); super(Node.MAP, schema);
this.items = []; this.items = [];
} }
static get tagName() {
return 'tag:yaml.org,2002:map';
}
/** /**
* Adds a value to the collection. * Adds a value to the collection.
* *
@@ -13683,13 +13683,13 @@ var Scalar = __nccwpck_require__(9338);
var toJS = __nccwpck_require__(2463); var toJS = __nccwpck_require__(2463);
class YAMLSeq extends Collection.Collection { class YAMLSeq extends Collection.Collection {
static get tagName() {
return 'tag:yaml.org,2002:seq';
}
constructor(schema) { constructor(schema) {
super(Node.SEQ, schema); super(Node.SEQ, schema);
this.items = []; this.items = [];
} }
static get tagName() {
return 'tag:yaml.org,2002:seq';
}
add(value) { add(value) {
this.items.push(value); this.items.push(value);
} }
@@ -17681,6 +17681,7 @@ function createStringifyContext(doc, options) {
doubleQuotedAsJSON: false, doubleQuotedAsJSON: false,
doubleQuotedMinMultiLineLength: 40, doubleQuotedMinMultiLineLength: 40,
falseStr: 'false', falseStr: 'false',
flowCollectionPadding: true,
indentSeq: true, indentSeq: true,
lineWidth: 80, lineWidth: 80,
minContentWidth: 20, minContentWidth: 20,
@@ -17704,6 +17705,7 @@ function createStringifyContext(doc, options) {
return { return {
anchors: new Set(), anchors: new Set(),
doc, doc,
flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',
indent: '', indent: '',
indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ', indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ',
inFlow, inFlow,
@@ -17861,7 +17863,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
return str; return str;
} }
function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) { function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) {
const { indent, indentStep, options: { commentString } } = ctx; const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
itemIndent += indentStep; itemIndent += indentStep;
const itemCtx = Object.assign({}, ctx, { const itemCtx = Object.assign({}, ctx, {
indent: itemIndent, indent: itemIndent,
@@ -17930,7 +17932,7 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
str += `\n${indent}${end}`; str += `\n${indent}${end}`;
} }
else { else {
str = `${start} ${lines.join(' ')} ${end}`; str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
} }
} }
if (comment) { if (comment) {
@@ -18186,19 +18188,18 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
if (keyComment) if (keyComment)
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
} }
let vcb = ''; let vsb, vcb, valueComment;
let valueComment = null;
if (Node.isNode(value)) { if (Node.isNode(value)) {
if (value.spaceBefore) vsb = !!value.spaceBefore;
vcb = '\n'; vcb = value.commentBefore;
if (value.commentBefore) {
const cs = commentString(value.commentBefore);
vcb += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
}
valueComment = value.comment; valueComment = value.comment;
} }
else if (value && typeof value === 'object') { else {
value = doc.createNode(value); vsb = false;
vcb = null;
valueComment = null;
if (value && typeof value === 'object')
value = doc.createNode(value);
} }
ctx.implicitKey = false; ctx.implicitKey = false;
if (!explicitKey && !keyComment && Node.isScalar(value)) if (!explicitKey && !keyComment && Node.isScalar(value))
@@ -18213,24 +18214,50 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
!value.tag && !value.tag &&
!value.anchor) { !value.anchor) {
// If indentSeq === false, consider '- ' as part of indentation where possible // 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; let valueCommentDone = false;
const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true)); const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
let ws = ' '; let ws = ' ';
if (vcb || keyComment) { if (keyComment || vsb || vcb) {
if (valueStr === '' && !ctx.inFlow) ws = vsb ? '\n' : '';
ws = vcb === '\n' ? '\n\n' : vcb; if (vcb) {
else const cs = commentString(vcb);
ws = `${vcb}\n${ctx.indent}`; 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)) { else if (!explicitKey && Node.isCollection(value)) {
const flow = valueStr[0] === '[' || valueStr[0] === '{'; const vs0 = valueStr[0];
if (!flow || valueStr.includes('\n')) const nl0 = valueStr.indexOf('\n');
ws = `\n${ctx.indent}`; 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 = ''; ws = '';
}
str += ws + valueStr; str += ws + valueStr;
if (ctx.inFlow) { if (ctx.inFlow) {
if (valueCommentDone && onComment) if (valueCommentDone && onComment)
@@ -18488,7 +18515,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
} }
function plainString(item, ctx, onComment, onChompKeep) { function plainString(item, ctx, onComment, onChompKeep) {
const { type, value } = item; const { type, value } = item;
const { actualString, implicitKey, indent, inFlow } = ctx; const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
if ((implicitKey && /[\n[\]{},]/.test(value)) || if ((implicitKey && /[\n[\]{},]/.test(value)) ||
(inFlow && /[[\]{},]/.test(value))) { (inFlow && /[[\]{},]/.test(value))) {
return quotedString(value, ctx); return quotedString(value, ctx);
@@ -18512,9 +18539,14 @@ function plainString(item, ctx, onComment, onChompKeep) {
// Where allowed & type not set explicitly, prefer block style for multiline strings // Where allowed & type not set explicitly, prefer block style for multiline strings
return blockString(item, ctx, onComment, onChompKeep); return blockString(item, ctx, onComment, onChompKeep);
} }
if (indent === '' && containsDocumentMarker(value)) { if (containsDocumentMarker(value)) {
ctx.forceBlockIndent = true; if (indent === '') {
return blockString(item, ctx, onComment, onChompKeep); 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}`); const str = value.replace(/\n+/g, `$&\n${indent}`);
// Verify that output will be parsed as a string, as e.g. plain numbers and // Verify that output will be parsed as a string, as e.g. plain numbers and