diff --git a/packages/cli/src/helpers/registry.ts b/packages/cli/src/helpers/registry.ts index efd370c..ef46c29 100644 --- a/packages/cli/src/helpers/registry.ts +++ b/packages/cli/src/helpers/registry.ts @@ -7,7 +7,7 @@ export async function getRegistry( const registryResponse = await safeFetch(REGISTRY_URL(branch ?? 'main')) if (registryResponse.ok) { - const registryJson = registryResponse.json as Registry + const registryJson = (await registryResponse.response.json()) as Registry registryJson.base = registryJson.base.replace('{branch}', branch ?? 'main') return { diff --git a/packages/cli/src/helpers/safeFetcher.ts b/packages/cli/src/helpers/safeFetcher.ts index 7f63d5b..c9ed4bd 100644 --- a/packages/cli/src/helpers/safeFetcher.ts +++ b/packages/cli/src/helpers/safeFetcher.ts @@ -2,12 +2,12 @@ import fetch, {Response} from 'node-fetch' export async function safeFetch( url: string, -): Promise<{ok: true; json: unknown} | {ok: false; message: string; response: Response}> { +): Promise<{ok: true; response: Response} | {ok: false; message: string; response: Response}> { const response = await fetch(url) if (response.ok) { return { ok: true, - json: await response.json(), + response, } }