(filepath: string)
| 44 | * Returns true if the path is an image file. |
| 45 | */ |
| 46 | export const isImageFile = (filepath: string): boolean => { |
| 47 | const ext = path.extname(filepath).slice(1).toLowerCase() |
| 48 | return !!ext && IMAGE_EXTENSIONS.includes(ext) && isFile(filepath) |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Returns true if the path is a markdown file or symbolic link to one. |
no test coverage detected