11 lines
301 B
TypeScript
11 lines
301 B
TypeScript
|
import { ImageFormats, ImageSize } from "../types/cdnTypes.ts";
|
||
|
|
||
|
export const ImageURL = (
|
||
|
url: string,
|
||
|
format: ImageFormats,
|
||
|
size?: ImageSize | 128
|
||
|
) => {
|
||
|
if (url.includes('a_')) {
|
||
|
return url + '.gif' + '?size=' + size
|
||
|
} else return url + '.' + format + '?size=' + size
|
||
|
}
|