mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: fix verdict
This commit is contained in:
1 file changed
+4
-3
@@ -1,12 +1,13 @@
|
|||||||
import { STATUS } from '@hydrooj/common';
|
import { STATUS } from '@hydrooj/common';
|
||||||
|
|
||||||
export function normalize(key: string) {
|
export function normalize(key: string) {
|
||||||
return key.toUpperCase().replace(/ _-/g, '');
|
return key.toUpperCase().replace(/[ _-]/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeSlash(src: Record<string, STATUS>) {
|
function removeSlash(src: Record<string, STATUS>) {
|
||||||
for (const key in Object.keys(src)) src[key.replace(/_/g, '')] = src[key];
|
const dst = {};
|
||||||
return src;
|
for (const key of Object.keys(src)) dst[key.replace(/_/g, '')] = src[key];
|
||||||
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VERDICT = new Proxy<Record<string, STATUS>>(removeSlash({
|
export const VERDICT = new Proxy<Record<string, STATUS>>(removeSlash({
|
||||||
|
|||||||
Reference in new issue
Block a user