feat: hero stat

This commit is contained in:
TrèsAbhi committed 2024-03-25 18:00:07 -05:00
1 parent 9717f153cd
commit ebb7618f2d
10 files changed
+238 -43

No files matched your search

+3 -1
View File
@@ -2,7 +2,9 @@ import sharp from 'sharp';
const cache: Record<string, Buffer> = {};
export async function iconPng(url: string) {
export async function webpToPng(url: string) {
if (!url.endsWith('.webp')) return url;
if (!cache[url]) {
const imageResponse = await fetch(url);
const imageBufferWEBP = await imageResponse.arrayBuffer();
+2 -2
View File
@@ -1,6 +1,6 @@
import { iconPng } from './iconPng';
import { webpToPng } from './iconPng';
import { tankIcon } from './tankIcon';
export function tankIconPng(id: number) {
return iconPng(tankIcon(id));
return webpToPng(tankIcon(id));
}