From b38e3a9dbf8c3a4f42abc0e0324cfc2df16d1cbc Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 14 Sep 2023 09:47:40 -0500 Subject: [PATCH] chore: add overdue stricter type i don't feel great about this but progress is progress lol --- src/lib/prompts.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lib/prompts.ts b/src/lib/prompts.ts index 800d495f7..502158860 100644 --- a/src/lib/prompts.ts +++ b/src/lib/prompts.ts @@ -76,9 +76,7 @@ const updateOasPrompt = ( const newSpecs = await getSpecs(`${parsedDocs?.prev?.url || ''}`); const newParsedDocs = parse(newSpecs.headers.get('link')); const newSpecList = await handleRes(newSpecs); - // @todo: figure out how to add a stricter type here, see: - // https://github.com/readmeio/rdme/pull/570#discussion_r949715913 - const { specId } = await promptTerminal( + const { specId }: { specId: string } = await promptTerminal( updateOasPrompt(newSpecList, newParsedDocs, currPage - 1, totalPages, getSpecs), ); return specId; @@ -90,9 +88,7 @@ const updateOasPrompt = ( const newSpecs = await getSpecs(`${parsedDocs?.next?.url || ''}`); const newParsedDocs = parse(newSpecs.headers.get('link')); const newSpecList = await handleRes(newSpecs); - // @todo: figure out how to add a stricter type here, see: - // https://github.com/readmeio/rdme/pull/570#discussion_r949715913 - const { specId } = await promptTerminal( + const { specId }: { specId: string } = await promptTerminal( updateOasPrompt(newSpecList, newParsedDocs, currPage + 1, totalPages, getSpecs), ); return specId; @@ -123,9 +119,9 @@ export function createOasPrompt( ], async format(picked: OpenapiPromptOptions) { if (picked === 'update') { - // @todo: figure out how to add a stricter type here, see: - // https://github.com/readmeio/rdme/pull/570#discussion_r949715913 - const { specId } = await promptTerminal(updateOasPrompt(specList, parsedDocs, 1, totalPages, getSpecs)); + const { specId }: { specId: string } = await promptTerminal( + updateOasPrompt(specList, parsedDocs, 1, totalPages, getSpecs), + ); return specId; }