From 578f32f8759282cf5ecd14055f7a6cc77dacf4ed Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 3 Jun 2023 07:01:57 +0300 Subject: [PATCH] Handle capitalized asset file extensions --- utils/getAssetType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/getAssetType.ts b/utils/getAssetType.ts index f99c534..ac2a992 100644 --- a/utils/getAssetType.ts +++ b/utils/getAssetType.ts @@ -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'