We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0126ce commit 3a5586cCopy full SHA for 3a5586c
packages/vjudge/src/verdict.ts
@@ -1,12 +1,13 @@
1
import { STATUS } from '@hydrooj/common';
2
3
export function normalize(key: string) {
4
- return key.toUpperCase().replace(/ _-/g, '');
+ return key.toUpperCase().replace(/[ _-]/g, '');
5
}
6
7
function removeSlash(src: Record<string, STATUS>) {
8
- for (const key in Object.keys(src)) src[key.replace(/_/g, '')] = src[key];
9
- return src;
+ const dst = {};
+ for (const key of Object.keys(src)) dst[key.replace(/_/g, '')] = src[key];
10
+ return dst;
11
12
13
export const VERDICT = new Proxy<Record<string, STATUS>>(removeSlash({
0 commit comments