fix config parse fallback

This commit is contained in:
undefined committed 2026-08-12 10:54:31 +08:00
1 parent fc67389b49
commit 87f64d60fd
1 file changed
+1 -1
+1 -1
View File
@@ -6,7 +6,7 @@ import type { ProblemConfig } from '../interface';
export async function parseConfig(config: string | ProblemConfigFile = {}, files: string[]) {
const cfg: ProblemConfigFile = typeof config === 'string'
? await readYamlCases(load(config) as Record<string, any>)
? await readYamlCases(load(config || '{}') as Record<string, any>)
: await readYamlCases(config);
const result: ProblemConfig = {
count: Object.keys(cfg.answers || {}).length || Math.sum((cfg.subtasks || []).map((s) => s.cases.length)),