Update getAssetType()
This commit is contained in:
parent
03c8a86417
commit
f39e06508e
@ -1,6 +1,6 @@
|
||||
/* eslint-disable eslint-comments/disable-enable-pair */
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
export type AssetType = 'image' | 'audio' | 'video' | 'unknown'
|
||||
export type AssetType = 'image' | 'audio' | 'video' | 'html' | 'unknown'
|
||||
|
||||
export const getAssetType = (assetFileName: string): AssetType => {
|
||||
const assetType = assetFileName?.split('.').pop() || 'unknown'
|
||||
@ -8,5 +8,6 @@ export const getAssetType = (assetFileName: string): AssetType => {
|
||||
return 'image'
|
||||
if (assetType === 'mp3' || assetType === 'wav') return 'audio'
|
||||
if (assetType === 'mp4') return 'video'
|
||||
if (assetType === 'html') return 'html'
|
||||
return 'unknown'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user