Skip to content

Commit

Permalink
chore: apply hotfixes requested by the TSC
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Feb 28, 2024
1 parent b9d1c4e commit 1d70c58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion app/[locale]/next-data/api-data/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { deflateSync } from 'node:zlib';

import getReleaseData from '@/next-data/releaseData';
import { VERCEL_REVALIDATE } from '@/next.constants.mjs';
import { defaultLocale } from '@/next.locales.mjs';
import type { GitHubApiFile } from '@/types';
Expand All @@ -13,7 +14,15 @@ const getPathnameForApiFile = (name: string) =>
// for a digest and metadata of all API pages from the Node.js Website
// @see https://nextjs.org/docs/app/building-your-application/routing/router-handlers
export const GET = async () => {
const gitHubApiResponse = await fetch(getGitHubApiDocsUrl('main'));
const releases = await getReleaseData();

const latestLTSRelease = releases.find(release =>
['Active LTS', 'Maintenance LTS'].includes(release.status)
);

const gitHubApiResponse = await fetch(
getGitHubApiDocsUrl(latestLTSRelease!.versionWithPrefix)
);

return gitHubApiResponse.json().then((apiDocsFiles: Array<GitHubApiFile>) => {
// maps over each api file and get the download_url, fetch the content and deflates it
Expand Down
8 changes: 4 additions & 4 deletions util/downloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export const platformItems = [
export const bitnessItems = {
WIN: [
{
label: '64-bit',
label: 'x64',
value: '64',
},
{
label: '32-bit',
label: 'x86',
value: '86',
},
{
Expand All @@ -57,7 +57,7 @@ export const bitnessItems = {
],
MAC: [
{
label: '64-bit',
label: 'x64',
value: '64',
},
{
Expand All @@ -67,7 +67,7 @@ export const bitnessItems = {
],
LINUX: [
{
label: '64-bit',
label: 'x64',
value: '64',
},
{
Expand Down

0 comments on commit 1d70c58

Please sign in to comment.