( filePath: string, extensions?: Iterable<string> | ReadonlySet<string> )
| 191 | * Check if a file is a code file |
| 192 | */ |
| 193 | export function isCodeFile( |
| 194 | filePath: string, |
| 195 | extensions?: Iterable<string> | ReadonlySet<string> |
| 196 | ): boolean { |
| 197 | const ext = path.extname(filePath).toLowerCase(); |
| 198 | const supportedExtensions = |
| 199 | extensions instanceof Set |
| 200 | ? extensions |
| 201 | : extensions |
| 202 | ? buildCodeExtensions(extensions) |
| 203 | : defaultCodeExtensions; |
| 204 | return supportedExtensions.has(ext); |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Check if a file is binary |
no test coverage detected