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
@@ -6,7 +6,7 @@
|
|||||||
"repository": "https://github.com/hydro-dev/Hydro",
|
"repository": "https://github.com/hydro-dev/Hydro",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antfu/eslint-config": "^5.3.0",
|
"@antfu/eslint-config": "^5.3.0",
|
||||||
"@eslint-react/eslint-plugin": "^1.53.0",
|
"@eslint-react/eslint-plugin": "^1.53.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
||||||
"@typescript-eslint/parser": "^8.43.0",
|
"@typescript-eslint/parser": "^8.43.0",
|
||||||
"eslint-plugin-de-morgan": "^1.3.1",
|
"eslint-plugin-de-morgan": "^1.3.1",
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ export async function extractZip<T>(zipOrEntries: ZipReader<T> | Entry[], dest:
|
|||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const name = shouldStrip ? entry.filename.substring(entries[0].filename.length) : entry.filename;
|
const name = shouldStrip ? entry.filename.substring(entries[0].filename.length) : entry.filename;
|
||||||
const d = sanitize(dest, canonical(name));
|
const d = sanitize(dest, canonical(name));
|
||||||
if (entry.directory) {
|
if (entry.directory === true) {
|
||||||
await fs.mkdir(d, { recursive: true });
|
await fs.mkdir(d, { recursive: true });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@
|
|||||||
"mongodb-memory-server": "10.2.0",
|
"mongodb-memory-server": "10.2.0",
|
||||||
"nyc": "^17.1.0",
|
"nyc": "^17.1.0",
|
||||||
"ora": "^8.2.0",
|
"ora": "^8.2.0",
|
||||||
"oxlint": "^1.14.0",
|
"oxlint": "^1.15.0",
|
||||||
"package-json": "^10.0.1",
|
"package-json": "^10.0.1",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.2",
|
||||||
"simple-git": "^3.28.0",
|
"simple-git": "^3.28.0",
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ class FpsProblemImportHandler extends Handler {
|
|||||||
}
|
}
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
try {
|
try {
|
||||||
|
if (entry.directory === true) continue;
|
||||||
if (entry.uncompressedSize > SystemModel.get('import-fps.limit')) throw new FileTooLargeError();
|
if (entry.uncompressedSize > SystemModel.get('import-fps.limit')) throw new FileTooLargeError();
|
||||||
const content = entry.getData(new Zip.TextWriter());
|
const content = entry.getData(new Zip.TextWriter());
|
||||||
const result = await xml2js.parseStringPromise(content);
|
const result = await xml2js.parseStringPromise(content);
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
|||||||
throw new ValidationError('zip', null, e.message);
|
throw new ValidationError('zip', null, e.message);
|
||||||
}
|
}
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
if (!entry.filename || entry.directory) continue;
|
if (!entry.filename || entry.directory === true) continue;
|
||||||
files.push({
|
files.push({
|
||||||
type,
|
type,
|
||||||
name: sanitize(entry.filename),
|
name: sanitize(entry.filename),
|
||||||
|
|||||||
@@ -385,7 +385,8 @@ export async function run({
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new ValidationError('zip', null, e.message);
|
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 */ }
|
} catch { /* ignore no code */ }
|
||||||
const result = JSON.parse(Buffer.from(rdoc.result, 'base64').toString('utf8'));
|
const result = JSON.parse(Buffer.from(rdoc.result, 'base64').toString('utf8'));
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
"style-loader": "^4.0.0",
|
"style-loader": "^4.0.0",
|
||||||
"stylus": "^0.64.0",
|
"stylus": "^0.64.0",
|
||||||
"stylus-loader": "7.1.2",
|
"stylus-loader": "7.1.2",
|
||||||
"svgtofont": "^6.4.0",
|
"svgtofont": "^6.4.1",
|
||||||
"tether": "1.4.7",
|
"tether": "1.4.7",
|
||||||
"tether-drop": "^1.4.2",
|
"tether-drop": "^1.4.2",
|
||||||
"timeago-react": "^3.0.7",
|
"timeago-react": "^3.0.7",
|
||||||
|
|||||||
Reference in new issue
Block a user