core: fix js-yaml options

This commit is contained in:
undefined committed 2026-07-25 11:25:38 +00:00
1 parent 2f99407669
commit 591dbd31c0
9 files changed
+25 -29

No files matched your search

+2 -2
View File
@@ -113,10 +113,10 @@ ${padEnd(formatSeconds(Math.floor((Date.now() - i.pm2_env.pm_uptime) / 1000), fa
infoDetails['now'] = new Date().toISOString();
infos['now'] = new Date().toISOString();
logger.info('System info:');
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
console.log(yaml.dump(infos, { schema: yaml.CORE_SCHEMA, seqNoIndent: true, lineWidth: process.stdout.columns || 80 }));
logger.info('Uploading detail to pastebin...');
const tmpFile = path.join(tmpdir(), 'report.yaml');
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 300 }));
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { seqNoIndent: true, lineWidth: 300 }));
if (process.env.VSCODE_INJECTION) {
try {
child.exec(`code ${tmpFile}`);
+2 -6
View File
@@ -1,4 +1,5 @@
import { dump } from 'js-yaml';
import { cloneDeepWith } from 'lodash';
import superagent from 'superagent';
import type { StatusUpdate } from '@hydrooj/utils/lib/sysinfo';
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
@@ -55,12 +56,7 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
info.dbVersion = status.version;
} catch (e) { }
await bus.serial('monitor/collect', info);
const payload = dump(info, {
replacer: (key, value) => {
if (typeof value === 'function') return '';
return value;
},
});
const payload = dump(cloneDeepWith(info, (value) => typeof value === 'function' ? '' : undefined));
if (process.env.CI) return [mid, $update];
superagent.post(`${system.get('server.center')}/report`)
.send({ installId, payload })