(filepath: string)
| 52 | * Returns true if the path is a markdown file or symbolic link to one. |
| 53 | */ |
| 54 | export const isMarkdownFile = (filepath: string): boolean => { |
| 55 | if (!isFile2(filepath)) return false |
| 56 | |
| 57 | if (isSymbolicLink(filepath)) { |
| 58 | const targetPath = path.resolve(path.dirname(filepath), fs.readlinkSync(filepath)) |
| 59 | return isFile(targetPath) && hasMarkdownExtension(targetPath) |
| 60 | } |
| 61 | return hasMarkdownExtension(filepath) |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Check if the both paths point to the same file. |
no test coverage detected