fix(judge): replace 'let' with 'const' for variables that are never reassigned

This commit is contained in:
cfngc4594 2025-03-01 23:22:15 +08:00
parent 4ad9bac50b
commit c52748734f

View File

@ -51,8 +51,8 @@ async function compileCode(container: Docker.Container, filePath: string, fileNa
return reject(new Error("Stream is undefined")); return reject(new Error("Stream is undefined"));
} }
let stdoutChunks: string[] = []; const stdoutChunks: string[] = [];
let stderrChunks: string[] = []; const stderrChunks: string[] = [];
const stdoutStream = new Writable({ const stdoutStream = new Writable({
write(chunk, encoding, callback) { write(chunk, encoding, callback) {
@ -102,8 +102,8 @@ async function runCode(container: Docker.Container, fileName: string) {
return reject(new Error("Stream is undefined")); return reject(new Error("Stream is undefined"));
} }
let stdoutChunks: string[] = []; const stdoutChunks: string[] = [];
let stderrChunks: string[] = []; const stderrChunks: string[] = [];
const stdoutStream = new Writable({ const stdoutStream = new Writable({
write(chunk, encoding, callback) { write(chunk, encoding, callback) {