Skip to content

Commit

Permalink
chore: fix ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 29, 2023
1 parent 3270fbc commit 5ca744c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion routes/repos/[owner]/[repo]/files/[branch]/[...path].ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default eventHandler(async (event) => {
const repo = `${event.context.params.owner}/${event.context.params.repo}`;
const ref = `${event.context.params.branch}/${event.context.params.path}`;
const url = `https://raw.githubusercontent.com/${repo}/${ref}`;
const contents = (await $fetch(url)) as string;
const contents = await $fetch<string>(url);

const file: GithubFileData = { contents };

Expand Down
2 changes: 1 addition & 1 deletion routes/repos/[owner]/[repo]/readme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default cachedEventHandler(
async (event) => {
const repo = `${event.context.params.owner}/${event.context.params.repo}`;
const markdown = await $fetch(
const markdown = await $fetch<string>(
`https://raw.githubusercontent.com/${repo}/main/README.md`,
);
const html = await ghMarkdown(markdown, repo, "readme");
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"paths": {
"~types": ["./types"]
}
},
"skipLibCheck": true
}
}

0 comments on commit 5ca744c

Please sign in to comment.