MCPcopy
hub / github.com/openclaw/clawsweeper / parseReportFileName

Function parseReportFileName

src/clawsweeper.ts:1932–1938  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

1930}
1931
1932function 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
1940function markdownRepository(markdown: string, file?: string): string {
1941 const fromMarkdown = frontMatterValue(markdown, "repository");

Callers 5

markdownRepositoryFunction · 0.85
reportEntriesForDirFunction · 0.85
applyArtifactsCommandFunction · 0.85
markdownFilesFunction · 0.85
numberForMarkdownFileFunction · 0.85

Calls 2

repositoryProfileForSlugFunction · 0.85
matchMethod · 0.80

Tested by

no test coverage detected