Merge pull request #166 from public-awesome/develop

Sync development > main
This commit is contained in:
Serkan Reis 2023-06-03 14:10:04 +03:00 committed by GitHub
commit 93b8a541e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
export type AssetType = 'image' | 'audio' | 'video' | 'html' | 'unknown'
export const getAssetType = (assetFileName: string): AssetType => {
const assetType = assetFileName?.split('.').pop() || 'unknown'
const assetType = assetFileName?.toLowerCase().split('.').pop() || 'unknown'
if (assetType === 'png' || assetType === 'jpg' || assetType === 'jpeg' || assetType === 'svg' || assetType === 'gif')
return 'image'
if (assetType === 'mp3' || assetType === 'wav') return 'audio'