(file: string)
| 1930 | } |
| 1931 | |
| 1932 | function parseReportFileName(file: string): { repo: string | undefined; number: number } | null { |
| 1933 | const numeric = file.match(/^(\d+)\.md$/); |
| 1934 | if (numeric?.[1]) return { repo: undefined, number: Number(numeric[1]) }; |
| 1935 | const prefixed = file.match(/^([a-z0-9][a-z0-9-]*)-(\d+)\.md$/); |
| 1936 | if (!prefixed?.[1] || !prefixed[2]) return null; |
| 1937 | return { repo: repositoryProfileForSlug(prefixed[1])?.targetRepo, number: Number(prefixed[2]) }; |
| 1938 | } |
| 1939 | |
| 1940 | function markdownRepository(markdown: string, file?: string): string { |
| 1941 | const fromMarkdown = frontMatterValue(markdown, "repository"); |
no test coverage detected