2020-10-25 17:03:53 +00:00
|
|
|
import { ImageFormats, ImageSize } from '../types/cdnTypes.ts'
|
2020-10-23 03:19:40 +00:00
|
|
|
|
|
|
|
export const ImageURL = (
|
2020-10-25 17:03:53 +00:00
|
|
|
url: string,
|
|
|
|
format: ImageFormats,
|
|
|
|
size?: ImageSize | 128
|
|
|
|
): string => {
|
|
|
|
if (url.includes('a_')) {
|
|
|
|
return `${url}.gif?size=${size}`
|
|
|
|
} else return `${url}.${format}?size=${size}`
|
|
|
|
}
|