fix: default to main for stable selection

This commit is contained in:
iCrawl
2022-10-14 23:38:08 +02:00
parent 8af0b38b6c
commit 94097d365a

View File

@@ -18,7 +18,7 @@ export const getStaticProps: GetStaticProps = async () => {
PACKAGES.map(async (pkg) => {
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${pkg}`);
const versions = await response.json();
const latestVersion = versions.at(-2);
const latestVersion = versions.at(-2) ?? 'main';
return { packageName: pkg, version: latestVersion };
}),
);