Add .gif among supported asset formats
This commit is contained in:
parent
596f7806ed
commit
6c3703d97b
@ -4,7 +4,8 @@ export type AssetType = 'image' | 'audio' | 'video' | 'unknown'
|
||||
|
||||
export const getAssetType = (assetFileName: string): AssetType => {
|
||||
const assetType = assetFileName?.split('.').pop() || 'unknown'
|
||||
if (assetType === 'png' || assetType === 'jpg' || assetType === 'jpeg' || assetType === 'svg') return 'image'
|
||||
if (assetType === 'png' || assetType === 'jpg' || assetType === 'jpeg' || assetType === 'svg' || assetType === 'gif')
|
||||
return 'image'
|
||||
if (assetType === 'mp3' || assetType === 'wav') return 'audio'
|
||||
if (assetType === 'mp4') return 'video'
|
||||
return 'unknown'
|
||||
|
Loading…
Reference in New Issue
Block a user