node_modules: update (#146)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurla
2026-08-07 08:08:41 +02:00
committed by GitHub
co-authored by dawidd6
parent 6b3dfab4e0
commit 3d5a3a75cc
44 changed files with 660 additions and 284 deletions
+1
View File
@@ -22,6 +22,7 @@ function createStringifyContext(doc, options) {
nullStr: 'null',
simpleKeys: false,
singleQuote: null,
trailingComma: false,
trueStr: 'true',
verifyAliasOrder: true
}, doc.schema.toStringOptions, options);
+13 -3
View File
@@ -104,12 +104,22 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
if (comment)
reqNewline = true;
let str = stringify.stringify(item, itemCtx, () => (comment = null));
if (i < items.length - 1)
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes('\n'));
if (i < items.length - 1) {
str += ',';
}
else if (ctx.options.trailingComma) {
if (ctx.options.lineWidth > 0) {
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) +
(str.length + 2) >
ctx.options.lineWidth);
}
if (reqNewline) {
str += ',';
}
}
if (comment)
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
if (!reqNewline && (lines.length > linesAtValue || str.includes('\n')))
reqNewline = true;
lines.push(str);
linesAtValue = lines.length;
}
+2 -1
View File
@@ -10,7 +10,8 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
if (!format &&
minFractionDigits &&
(!tag || tag === 'tag:yaml.org,2002:float') &&
/^\d/.test(n)) {
/^-?\d/.test(n) &&
!n.includes('e')) {
let i = n.indexOf('.');
if (i < 0) {
i = n.length;