make ci happy

This commit is contained in:
undefined committed 2024-11-13 11:31:35 +08:00
1 parent 7f1a6a0f9a
commit fbfe3e4c7c
3 files changed
+4 -7

No files matched your search

+1
View File
@@ -25,6 +25,7 @@
"adm-zip": "0.5.14",
"cac": "^6.7.14",
"cordis": "3.18.1",
"csv-stringify": "^6.5.1",
"emoji-regex": "^10.4.0",
"emojis-list": "2.1.0",
"fs-extra": "^11.2.0",
+2 -6
View File
@@ -1,9 +1,9 @@
import AdmZip from 'adm-zip';
import { stringify as toCSV } from 'csv-stringify/sync';
import { statSync } from 'fs-extra';
import { pick } from 'lodash';
import moment from 'moment-timezone';
import { ObjectId } from 'mongodb';
import Schema from 'schemastery';
import {
Counter, sortFiles, streamToBuffer, Time, yaml,
} from '@hydrooj/utils/lib/utils';
@@ -861,11 +861,7 @@ export async function apply(ctx: Context) {
const [, rows] = await contest.getScoreboard.call(this, tdoc.domainId, tdoc._id, {
isExport: true, lockAt: this.tdoc.lockAt, showDisplayName: this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME),
});
const escapeValue = (i: string) => `"${i.toString().replace(/\n/g, ' ').replace(/"/g, '\\"')}"`;
this.binary(
`\uFEFF${rows.map((c) => (c.map((i) => escapeValue(i.value)).join(','))).join('\n')}`,
`${this.tdoc.title}.csv`,
);
this.binary(toCSV(rows.map((r) => r.map((c) => c.value.toString()))), `${this.tdoc.title}.csv`);
},
supportedRules: ['*'],
});
+1 -1
View File
@@ -4,7 +4,7 @@
"version": "0.0.1",
"main": "index.ts",
"scripts": {
"install": "node -r @hydrooj/register install.ts"
"postinstall": "node -r @hydrooj/register install.ts"
},
"dependencies": {
"@xcpcio/board-app": "^0.53.2"