Skip to content

Commit 3a5586c

Browse files
committed
vjudge: fix verdict
1 parent a0126ce commit 3a5586c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/vjudge/src/verdict.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { STATUS } from '@hydrooj/common';
22

33
export function normalize(key: string) {
4-
return key.toUpperCase().replace(/ _-/g, '');
4+
return key.toUpperCase().replace(/[ _-]/g, '');
55
}
66

77
function removeSlash(src: Record<string, STATUS>) {
8-
for (const key in Object.keys(src)) src[key.replace(/_/g, '')] = src[key];
9-
return src;
8+
const dst = {};
9+
for (const key of Object.keys(src)) dst[key.replace(/_/g, '')] = src[key];
10+
return dst;
1011
}
1112

1213
export const VERDICT = new Proxy<Record<string, STATUS>>(removeSlash({

0 commit comments

Comments
 (0)