diff options
| author | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
| commit | 32f01e3e328db0006a55c6324625b49d60244b66 (patch) | |
| tree | b97866549b919964957365e1e05681e85af7021a /lib/upload.ts | |
| parent | a1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff) | |
| download | coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip | |
fix typescript issues
Diffstat (limited to 'lib/upload.ts')
| -rw-r--r-- | lib/upload.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |
