mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
make ci happy
This commit is contained in:
3 files changed
+4
-7
No files matched your search
@@ -25,6 +25,7 @@
|
|||||||
"adm-zip": "0.5.14",
|
"adm-zip": "0.5.14",
|
||||||
"cac": "^6.7.14",
|
"cac": "^6.7.14",
|
||||||
"cordis": "3.18.1",
|
"cordis": "3.18.1",
|
||||||
|
"csv-stringify": "^6.5.1",
|
||||||
"emoji-regex": "^10.4.0",
|
"emoji-regex": "^10.4.0",
|
||||||
"emojis-list": "2.1.0",
|
"emojis-list": "2.1.0",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import AdmZip from 'adm-zip';
|
import AdmZip from 'adm-zip';
|
||||||
|
import { stringify as toCSV } from 'csv-stringify/sync';
|
||||||
import { statSync } from 'fs-extra';
|
import { statSync } from 'fs-extra';
|
||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
import moment from 'moment-timezone';
|
import moment from 'moment-timezone';
|
||||||
import { ObjectId } from 'mongodb';
|
import { ObjectId } from 'mongodb';
|
||||||
import Schema from 'schemastery';
|
|
||||||
import {
|
import {
|
||||||
Counter, sortFiles, streamToBuffer, Time, yaml,
|
Counter, sortFiles, streamToBuffer, Time, yaml,
|
||||||
} from '@hydrooj/utils/lib/utils';
|
} 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, {
|
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),
|
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(toCSV(rows.map((r) => r.map((c) => c.value.toString()))), `${this.tdoc.title}.csv`);
|
||||||
this.binary(
|
|
||||||
`\uFEFF${rows.map((c) => (c.map((i) => escapeValue(i.value)).join(','))).join('\n')}`,
|
|
||||||
`${this.tdoc.title}.csv`,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
supportedRules: ['*'],
|
supportedRules: ['*'],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "node -r @hydrooj/register install.ts"
|
"postinstall": "node -r @hydrooj/register install.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@xcpcio/board-app": "^0.53.2"
|
"@xcpcio/board-app": "^0.53.2"
|
||||||
|
|||||||
Reference in new issue
Block a user