run npm ci to regenerate dist/ folder

This commit is contained in:
Jeff Widman
2022-12-05 06:38:23 +00:00
parent 73290048cf
commit aa1a97eee8

28
dist/index.js generated vendored
View File

@@ -10701,7 +10701,7 @@ function composeNode(ctx, token, props, onError) {
node.srcToken = token;
return node;
}
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag }, onError) {
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
const token = {
type: 'scalar',
offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
@@ -10716,8 +10716,10 @@ function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anch
}
if (spaceBefore)
node.spaceBefore = true;
if (comment)
if (comment) {
node.comment = comment;
node.range[2] = end;
}
return node;
}
function composeAlias({ options }, { offset, source, end }, onError) {
@@ -11078,6 +11080,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
if (ctx.atRoot)
ctx.atRoot = false;
let offset = bm.offset;
let commentEnd = null;
for (const collItem of bm.items) {
const { start, key, sep, value } = collItem;
// key properties
@@ -11097,7 +11100,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
onError(offset, 'BAD_INDENT', startColMsg);
}
if (!keyProps.anchor && !keyProps.tag && !sep) {
// TODO: assert being at last item?
commentEnd = keyProps.end;
if (keyProps.comment) {
if (map.comment)
map.comment += '\n' + keyProps.comment;
@@ -11167,7 +11170,9 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
map.items.push(pair);
}
}
map.range = [bm.offset, offset, offset];
if (commentEnd && commentEnd < offset)
onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
map.range = [bm.offset, offset, commentEnd ?? offset];
return map;
}
@@ -11395,6 +11400,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
if (ctx.atRoot)
ctx.atRoot = false;
let offset = bs.offset;
let commentEnd = null;
for (const { start, value } of bs.items) {
const props = resolveProps.resolveProps(start, {
indicator: 'seq-item-ind',
@@ -11403,16 +11409,15 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
onError,
startOnNewline: true
});
offset = props.end;
if (!props.found) {
if (props.anchor || props.tag || value) {
if (value && value.type === 'block-seq')
onError(offset, 'BAD_INDENT', 'All sequence items must start at the same column');
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
else
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
}
else {
// TODO: assert being at last item?
commentEnd = props.end;
if (props.comment)
seq.comment = props.comment;
continue;
@@ -11420,13 +11425,13 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
}
const node = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, offset, start, null, props, onError);
: composeEmptyNode(ctx, props.end, start, null, props, onError);
if (ctx.schema.compat)
utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
offset = node.range[2];
seq.items.push(node);
}
seq.range = [bs.offset, offset, offset];
seq.range = [bs.offset, offset, commentEnd ?? offset];
return seq;
}
@@ -12727,7 +12732,7 @@ function createNode(value, tagName, ctx) {
if (value instanceof String ||
value instanceof Number ||
value instanceof Boolean ||
(typeof BigInt === 'function' && value instanceof BigInt) // not supported everywhere
(typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere
) {
// https://tc39.es/ecma262/#sec-serializejsonproperty
value = value.valueOf();
@@ -17310,7 +17315,8 @@ class YAMLSet extends YAMLMap.YAMLMap {
let pair;
if (Node.isPair(key))
pair = key;
else if (typeof key === 'object' &&
else if (key &&
typeof key === 'object' &&
'key' in key &&
'value' in key &&
key.value === null)