1 2 3 4 5 6 7 8 9 10 11 12 13 14
export const getFormat = (mimeType) => { switch (mimeType) { case 'image/gif': return 'GIF'; case 'image/jpeg': return 'JPEG'; case 'image/png': return 'PNG'; case 'image/webp': return 'WebP'; default: return '???'; } };