mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
fix config parse fallback
This commit is contained in:
1 file changed
+1
-1
@@ -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)),
|
||||
|
||||
Reference in new issue
Block a user