Map a Node.language to the comment-stripper's language set.
(language: string)
| 187 | |
| 188 | /** Map a Node.language to the comment-stripper's language set. */ |
| 189 | function commentLang(language: string): CommentLang | null { |
| 190 | switch (language) { |
| 191 | case 'python': return 'python'; |
| 192 | case 'ruby': return 'ruby'; |
| 193 | case 'rust': return 'rust'; |
| 194 | case 'php': return 'php'; |
| 195 | case 'go': return 'go'; |
| 196 | case 'javascript': |
| 197 | case 'jsx': |
| 198 | return 'javascript'; |
| 199 | case 'typescript': |
| 200 | case 'tsx': |
| 201 | case 'vue': |
| 202 | case 'svelte': |
| 203 | case 'astro': |
| 204 | case 'arkts': |
| 205 | return 'typescript'; |
| 206 | case 'java': |
| 207 | case 'kotlin': |
| 208 | case 'scala': |
| 209 | case 'dart': |
| 210 | return 'java'; |
| 211 | case 'csharp': return 'csharp'; |
| 212 | case 'swift': return 'swift'; |
| 213 | case 'c': |
| 214 | case 'cpp': |
| 215 | case 'objc': |
| 216 | case 'objcpp': |
| 217 | return 'java'; // C-style comments + double-quoted strings — close enough for blanking |
| 218 | default: return null; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | const MAX_MATCHES_PER_BODY = 3; |
| 223 | const MAX_BODY_CHARS = 60_000; // a god-function tail is still scannable; beyond this, truncate |
no outgoing calls
no test coverage detected