(language: string)
| 91 | } |
| 92 | |
| 93 | export function genFileExt(language: string): string { |
| 94 | const ext: string | undefined = langExt.get(language); |
| 95 | if (!ext) { |
| 96 | throw new Error(`The language "${language}" is not supported.`); |
| 97 | } |
| 98 | return ext; |
| 99 | } |
| 100 | |
| 101 | export function fileMeta(content: string): ProblemMeta | null { |
| 102 | const result: RegExpExecArray | null = /@lc app=(.*) id=(.*|\w*|\W*|[\\u4e00-\\u9fa5]*) lang=(.*)/.exec(content); |