mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix build
This commit is contained in:
7 files changed
+8
-6
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user