core: try to fix #121

This commit is contained in:
undefined committed 2021-04-27 22:40:58 +08:00
1 parent d77d7d9ade
commit 00586b5883
8 files changed
+22 -13

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ export async function parseConfig(config: string | ProblemConfig = {}) {
timeMax: 0,
};
let cfg: ProblemConfig = {};
if (typeof config === 'string' && config.length) {
if (typeof config === 'string') {
// TODO should validate here?
cfg = await readYamlCases(load(config) as Record<string, any>);
} else if (typeof config === 'object') cfg = await readYamlCases(config);