From 6c19a43bfa15472a067306f6cf715de01ab97ea9 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 12 Aug 2024 03:33:30 +0800 Subject: [PATCH] fix code scanning alerts --- packages/hydrooj/src/handler/contest.ts | 4 ++-- packages/hydrooj/src/ui.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index fce6e3d0c..9d85c3d63 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -564,7 +564,7 @@ export class ContestManagementHandler extends ContestManagementBaseHandler { files: sortFiles(this.tdoc.files || []), udict: await user.getListForRender( domainId, tcdocs.map((i) => i.owner), - this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : [] + this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : [], ), tcdocs, urlForFile: (filename: string) => this.url('contest_file_download', { tid, filename }), @@ -673,7 +673,7 @@ export class ContestUserHandler extends ContestManagementBaseHandler { } const udict = await user.getListForRender( domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)], - this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : [] + this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : [], ); this.response.body = { tdoc: this.tdoc, tsdocs, udict }; this.response.pjax = 'partials/contest_user.html'; diff --git a/packages/hydrooj/src/ui.ts b/packages/hydrooj/src/ui.ts index 57747aca6..452101960 100644 --- a/packages/hydrooj/src/ui.ts +++ b/packages/hydrooj/src/ui.ts @@ -50,7 +50,7 @@ process.stdin.on('data', (buf) => { } else executeCommand(input); }); -export const useReadline = (callback: (string) => any) => { +export const useReadline = (callback: (str: string) => any) => { if (readlineCallback) throw new Error('Already waiting for input.'); readlineCallback = callback; };