#107 #154 - Added file icon

This commit is contained in:
Simon Cambier
2023-02-19 12:29:14 +01:00
parent f398034950
commit ae08608e02
3 changed files with 29 additions and 17 deletions

View File

@@ -255,13 +255,12 @@ export function isFileIndexable(path: string): boolean {
}
export function isFileImage(path: string): boolean {
return (
path.endsWith('.png') || path.endsWith('.jpg') || path.endsWith('.jpeg')
)
const ext = getExtension(path)
return (ext === 'png' || ext === 'jpg' || ext === 'jpeg')
}
export function isFilePDF(path: string): boolean {
return path.endsWith('.pdf')
return getExtension(path) === 'pdf'
}
export function isFilePlaintext(path: string): boolean {