Skip to content

Commit e0d2cf6

Browse files
committed
small refactor
1 parent 7d3b410 commit e0d2cf6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/WorkersTemplates.astro

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ const latestCommit = await fetchWithToken(
1010
.then((r) => r.json())
1111
.then((r) => r[0].sha);
1212
13-
const res = await fetchWithToken(
13+
const contents = await fetchWithToken(
1414
`https://api.github.com/repos/${REPO}/contents/?ref=${latestCommit}`,
15-
);
16-
const json = await res.json();
15+
).then((r) => r.json());
1716
18-
const dirs = json.filter((ent: any) => ent.type === "dir");
17+
const dirs = contents.filter((ent: any) => ent.type === "dir");
1918
---
2019

2120
{

0 commit comments

Comments
 (0)