vjudge: fix verdict

This commit is contained in:
undefined committed 2026-02-24 04:20:59 +08:00
1 parent a0126ce99d
commit 3a5586cc5a
1 file changed
+4 -3
+4 -3
View File
@@ -1,12 +1,13 @@
import { STATUS } from '@hydrooj/common';
export function normalize(key: string) {
return key.toUpperCase().replace(/ _-/g, '');
return key.toUpperCase().replace(/[ _-]/g, '');
}
function removeSlash(src: Record<string, STATUS>) {
for (const key in Object.keys(src)) src[key.replace(/_/g, '')] = src[key];
return src;
const dst = {};
for (const key of Object.keys(src)) dst[key.replace(/_/g, '')] = src[key];
return dst;
}
export const VERDICT = new Proxy<Record<string, STATUS>>(removeSlash({