Skip to content

Commit 1aa63fb

Browse files
committed
2 parents f4d2618 + 2985820 commit 1aa63fb

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/utils/documents.server.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,19 @@ async function fetchApiContentsRemote(
595595
const directoryFiles =
596596
(await directoryFilesResponse.json()) as Array<GitHubFile>
597597

598-
file.children = await buildFileTree(
599-
directoryFiles,
600-
depth + 1,
601-
`${parentPath}${file.path}/`,
602-
)
598+
if (!Array.isArray(directoryFiles)) {
599+
console.warn(
600+
`Expected an array of files from GitHub API for directory ${file.path}, but received:\n`,
601+
JSON.stringify(directoryFiles),
602+
)
603+
// Leave file.children undefined
604+
} else {
605+
file.children = await buildFileTree(
606+
directoryFiles,
607+
depth + 1,
608+
`${parentPath}${file.path}/`,
609+
)
610+
}
603611
}
604612

605613
result.push(file)

src/utils/gh-sponsor-meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,5 +312,11 @@
312312
"name": "Detecting-AI",
313313
"imageUrl": "https://detecting-ai.com/images/favicon.png",
314314
"linkUrl": "https://detecting-ai.com/"
315+
},
316+
{
317+
"login": "fingerprintjs",
318+
"name": "Fingerprint",
319+
"imageUrl": "https://fingerprint.com/img/uploads/fingerprint_white_on_orange.png",
320+
"linkUrl": "https://fingerprint.com?utm_source=tanstack"
315321
}
316322
]

0 commit comments

Comments
 (0)