Skip to content

Commit c7c8fad

Browse files
authored
Merge pull request #60 from daeisbae/56-do-not-show-markdown-files-in-summarized-repo
Filter out any markdown files from the summarization (#56)
2 parents e8be143 + e57f84c commit c7c8fad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/[ownerSlug]/[repoSlug]/formatter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FileData } from '@/db/models/file'
12
import { FullFolder, FullRepository } from '@/service/get-db'
23

34
export function formatToMarkdown(fullRepo: FullRepository): string {
@@ -23,7 +24,7 @@ function recursiveFolderToMarkdown(
2324
? `- Reference: [\`${folder.path}\`](${url}/${folder.path}) \n`
2425
: ''
2526
markdown += `\n${folder.ai_summary}\n`
26-
folder.files.forEach((file) => {
27+
folder.files.filter(isNotMarkdownFile).forEach((file) => {
2728
markdown += `###### ${file.usage}\n`
2829
markdown += `---\n`
2930
markdown += file.name
@@ -42,3 +43,7 @@ function recursiveFolderToMarkdown(
4243
})
4344
return markdown
4445
}
46+
47+
function isNotMarkdownFile(file: FileData): boolean {
48+
return !file.name.includes('.md')
49+
}

0 commit comments

Comments
 (0)