mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
fix: handle older generated docs better
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { connect } from '@planetscale/database';
|
||||
import { N_RECENT_VERSIONS } from '~/util/constants';
|
||||
|
||||
const sql = connect({
|
||||
url: process.env.DATABASE_URL!,
|
||||
@@ -20,7 +21,7 @@ export async function fetchVersions(packageName: string): Promise<string[]> {
|
||||
]);
|
||||
|
||||
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
|
||||
return rows.map((row) => row.version);
|
||||
return rows.map((row) => row.version).slice(0, N_RECENT_VERSIONS);
|
||||
}
|
||||
|
||||
export async function fetchModelJSON(packageName: string, version: string): Promise<unknown | null> {
|
||||
|
||||
Reference in New Issue
Block a user