(path)
| 76 | } |
| 77 | |
| 78 | export const getPreviewFileExtension = (path) => { |
| 79 | const normalizedPath = String(path || '') |
| 80 | .trim() |
| 81 | .toLowerCase() |
| 82 | if (!normalizedPath) return '' |
| 83 | |
| 84 | const fileName = normalizedPath.split('/').pop() || '' |
| 85 | const dotIndex = fileName.lastIndexOf('.') |
| 86 | if (dotIndex <= 0) return '' |
| 87 | return fileName.slice(dotIndex) |
| 88 | } |
| 89 | |
| 90 | export const isMarkdownPreview = (path, previewType) => { |
| 91 | if (previewType === 'markdown') return true |
no outgoing calls
no test coverage detected