Files
discordeno/src/util/cdn.ts
T
Ayyan e49a23687e refactor!: organize directories and files (#268)
* refactor!: organize directory structure

* fix: avoid stack overflow err

* chore: swtch back to std/encoding for base64

* style: format source files
2020-12-22 21:26:27 +04:00

11 lines
256 B
TypeScript

import { ImageFormats, ImageSize } from "../types/types.ts";
export const formatImageURL = (
url: string,
size: ImageSize = 128,
format?: ImageFormats,
) => {
return `${url}.${format ||
(url.includes("/a_") ? "gif" : "jpg")}?size=${size}`;
};