From 1855a6a8ea2e166044ff3fe8b3bb16c30ca9ecaf Mon Sep 17 00:00:00 2001 From: Scott Gould Date: Thu, 19 Sep 2024 00:09:58 -0400 Subject: [PATCH] Fix errors --- src/index.ts | 2 +- src/utils.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index db88eb0..238e233 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ async function updateInstances(): Promise { const response = await fetch( "https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/instances/instances.json" ); - const json: Instance[] = await response.json(); + const json = await response.json() as Instance[]; for (const instance of json) { if (!instanceNames.has(instance.name)) { instances.push(instance as any); diff --git a/src/utils.ts b/src/utils.ts index 5445419..179743c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -25,12 +25,12 @@ export async function getApiUrls(url: string): Promise { url += "/"; } try { - const info = await fetch(`${url}.well-known/spacebar`).then((res) => - res.json() + const info: ApiUrls = await fetch(`${url}.well-known/spacebar`).then( + (res) => res.json() as Promise ); const api = info.api; const apiUrl = new URL(api); - const policies = await fetch( + const policies: any = await fetch( `${api}${ apiUrl.pathname.includes("api") ? "" : "api" }/policies/instance/domains`