( block: CodeBlock, index: number, langCounts: Map<string, number> )
| 130 | } |
| 131 | |
| 132 | function generateFileName( |
| 133 | block: CodeBlock, |
| 134 | index: number, |
| 135 | langCounts: Map<string, number> |
| 136 | ): string { |
| 137 | const count = langCounts.get(block.language) || 0; |
| 138 | langCounts.set(block.language, count + 1); |
| 139 | |
| 140 | const sourceBasename = path.basename(block.file, ".md"); |
| 141 | const ext = getExtension(block.language); |
| 142 | |
| 143 | return `${sourceBasename}_${count}${ext}`; |
| 144 | } |
| 145 | |
| 146 | function getExtension(language: string): string { |
| 147 | switch (language) { |
no test coverage detected
searching dependent graphs…