mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: the last of the errors
This commit is contained in:
1 parent
f802b997c0
commit
ac768d0897
13 files changed
+40
-30
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import sharp from 'sharp';
|
||||
import sharp from "sharp";
|
||||
|
||||
const cache: Record<string, Buffer> = {};
|
||||
|
||||
export async function iconPng(url: string) {
|
||||
if (!url.endsWith('.webp')) return url;
|
||||
if (!url.endsWith(".webp")) return url;
|
||||
|
||||
if (!cache[url]) {
|
||||
const imageResponse = await fetch(url);
|
||||
@@ -12,5 +12,5 @@ export async function iconPng(url: string) {
|
||||
cache[url] = imageBufferPNG;
|
||||
}
|
||||
|
||||
return `data:image/png;base64,${cache[url].toString('base64')}`;
|
||||
return `data:image/png;base64,${cache[url].toString("base64")}`;
|
||||
}
|
||||
Reference in new issue
Block a user