Skip to content

Commit

Permalink
chore: add overdue stricter type
Browse files Browse the repository at this point in the history
i don't feel great about this but progress is progress lol
  • Loading branch information
kanadgupta committed Sep 14, 2023
1 parent ea2e542 commit b38e3a9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/lib/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b38e3a9

Please sign in to comment.