From 32f01e3e328db0006a55c6324625b49d60244b66 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 28 Feb 2026 15:16:20 -0800 Subject: fix typescript issues --- lib/upload.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/upload.ts') diff --git a/lib/upload.ts b/lib/upload.ts index 900d49dd..3eb31250 100644 --- a/lib/upload.ts +++ b/lib/upload.ts @@ -15,17 +15,17 @@ export default async (c) => { let buf = Buffer.from(await (file as File).arrayBuffer()); - const [format, ext] = (await fileTypeFromBuffer(buf)).mime.split("/"); + const [format, ext] = (await fileTypeFromBuffer(buf as any)).mime.split("/"); if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) fail("unsupported file type"); const w = type === "banner" ? 1920 : 240; buf = await sharp(buf, { failOnError: false }).rotate().resize(w).webp().toBuffer(); - const hash = createHash("sha256").update(buf).digest("hex"); + const hash = createHash("sha256").update(buf as any).digest("hex"); const filePath = `/home/bun/app/data/uploads/${hash}.webp`; - writeFileSync(filePath, buf); + writeFileSync(filePath, buf as any); return c.json({ hash }); } catch (e) { -- cgit v1.2.3