mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-29 21:13:21 +00:00
9 lines
290 B
JavaScript
9 lines
290 B
JavaScript
module.exports = function isPreviewSupported (fileType) {
|
|
if (!fileType) return false
|
|
const fileTypeSpecific = fileType.split('/')[1]
|
|
// list of images that browsers can preview
|
|
if (/^(jpe?g|gif|png|svg|svg\+xml|bmp)$/.test(fileTypeSpecific)) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|