From 8aa42672ea6f36f5254796dc8432fb72699c8ddb Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Fri, 10 May 2024 21:24:14 +0200 Subject: [PATCH] revert some after fixing lock --- upgrade/src/app/api/og/route.tsx | 4 ++-- upgrade/src/lib/utils.ts | 2 +- www/src/utils/fetchGithub.ts | 2 +- www/src/utils/ogFont.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/upgrade/src/app/api/og/route.tsx b/upgrade/src/app/api/og/route.tsx index 92dc731543..10a49a8d10 100644 --- a/upgrade/src/app/api/og/route.tsx +++ b/upgrade/src/app/api/og/route.tsx @@ -103,7 +103,7 @@ async function getFont({ ";", )}${text ? `&text=${encodeURIComponent(text)}` : ""}`; - const css = (await ( + const css = await ( await fetch(API, { headers: { // Make sure it returns TTF. @@ -111,7 +111,7 @@ async function getFont({ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1", }, }) - ).text()) as string; + ).text(); const fonts = css .split("@font-face {") diff --git a/upgrade/src/lib/utils.ts b/upgrade/src/lib/utils.ts index 0401602559..698784d2e0 100644 --- a/upgrade/src/lib/utils.ts +++ b/upgrade/src/lib/utils.ts @@ -171,5 +171,5 @@ export const getDiffFromGithub = async (props: DiffLocation) => { throw new Error("Failed to download diff"); } - return response.text() as Promise; + return response.text(); }; diff --git a/www/src/utils/fetchGithub.ts b/www/src/utils/fetchGithub.ts index 8dbc933737..6684272565 100644 --- a/www/src/utils/fetchGithub.ts +++ b/www/src/utils/fetchGithub.ts @@ -71,7 +71,7 @@ export const fetchGithub = async ( }, }); - const data = (await res.json()) as unknown; + const data = await res.json(); if (!res.ok) { const msg = `Request to fetch ${url} failed. Reason: ${res.statusText} diff --git a/www/src/utils/ogFont.ts b/www/src/utils/ogFont.ts index a53d2ed890..0eb3a49294 100644 --- a/www/src/utils/ogFont.ts +++ b/www/src/utils/ogFont.ts @@ -13,7 +13,7 @@ export async function getFont({ ";", )}${text ? `&text=${encodeURIComponent(text)}` : ""}`; - const css = (await ( + const css = await ( await fetch(API, { headers: { // Make sure it returns TTF. @@ -21,7 +21,7 @@ export async function getFont({ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1", }, }) - ).text()) as string; + ).text(); const fonts = css .split("@font-face {")