fix build

This commit is contained in:
undefined committed 2025-09-12 05:08:48 +08:00
1 parent a7622cee59
commit 99f73b492b
7 files changed
+8 -6

No files matched your search

+1
View File
@@ -103,6 +103,7 @@ class FpsProblemImportHandler extends Handler {
}
for (const entry of entries) {
try {
if (entry.directory === true) continue;
if (entry.uncompressedSize > SystemModel.get('import-fps.limit')) throw new FileTooLargeError();
const content = entry.getData(new Zip.TextWriter());
const result = await xml2js.parseStringPromise(content);
+1 -1
View File
@@ -721,7 +721,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
throw new ValidationError('zip', null, e.message);
}
for (const entry of entries) {
if (!entry.filename || entry.directory) continue;
if (!entry.filename || entry.directory === true) continue;
files.push({
type,
name: sanitize(entry.filename),
+2 -1
View File
@@ -385,7 +385,8 @@ export async function run({
} catch (e) {
throw new ValidationError('zip', null, e.message);
}
data.code = await entries.find((i) => i.filename.endsWith('answer.code'))?.getData(new Zip.TextWriter()) || '';
const codeEntry = entries.find((i) => i.filename.endsWith('answer.code') && i.directory === false);
data.code = await (codeEntry as any)?.getData(new Zip.TextWriter()) || '';
} catch { /* ignore no code */ }
const result = JSON.parse(Buffer.from(rdoc.result, 'base64').toString('utf8'));
if (result.error) {
+1 -1
View File
@@ -107,7 +107,7 @@
"style-loader": "^4.0.0",
"stylus": "^0.64.0",
"stylus-loader": "7.1.2",
"svgtofont": "^6.4.0",
"svgtofont": "^6.4.1",
"tether": "1.4.7",
"tether-drop": "^1.4.2",
"timeago-react": "^3.0.7",