(filename: string)
| 104 | } |
| 105 | |
| 106 | export function isTextFile(filename: string): boolean { |
| 107 | const baseName = getBaseName(filename) |
| 108 | |
| 109 | // Special filenames that are text |
| 110 | if ( |
| 111 | baseName === 'dockerfile' || |
| 112 | baseName === 'makefile' || |
| 113 | baseName === 'gnumakefile' || |
| 114 | baseName === '.gitignore' || |
| 115 | baseName === '.gitattributes' || |
| 116 | baseName === '.editorconfig' || |
| 117 | baseName === '.env' || |
| 118 | baseName.startsWith('.env.') |
| 119 | ) { |
| 120 | return true |
| 121 | } |
| 122 | |
| 123 | const ext = getExtension(filename) |
| 124 | return TEXT_EXTENSIONS.has(ext) |
| 125 | } |
| 126 | |
| 127 | export function isImageFile(filename: string): boolean { |
| 128 | const ext = getExtension(filename) |
no test coverage detected