From ad7b09b43323d0ffc0a8ddabb43e4838a184c697 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 24 Feb 2026 13:18:42 -0800 Subject: formatting --- lib/upload.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/upload.ts') diff --git a/lib/upload.ts b/lib/upload.ts index 7b5ad86d..2ed5d905 100644 --- a/lib/upload.ts +++ b/lib/upload.ts @@ -16,15 +16,10 @@ export default async (req, res) => { const [format, ext] = (await fileTypeFromBuffer(buf)).mime.split("/"); - if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) - fail("unsupported file type"); + 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(); + buf = await sharp(buf, { failOnError: false }).rotate().resize(w).webp().toBuffer(); const hash = createHash("sha256").update(buf).digest("hex"); -- cgit v1.2.3