mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore: cleanup code
This commit is contained in:
@@ -33,7 +33,6 @@ export interface SidebarLayoutProps {
|
||||
data: {
|
||||
member: ReturnType<typeof findMember>;
|
||||
members: ReturnType<typeof getMembers>;
|
||||
searchIndex: any[];
|
||||
source: MDXRemoteSerializeResult;
|
||||
};
|
||||
packageName: string;
|
||||
|
||||
@@ -42,7 +42,6 @@ import { CmdKProvider } from '~/contexts/cmdK';
|
||||
import { MemberProvider } from '~/contexts/member';
|
||||
import { PACKAGES } from '~/util/constants';
|
||||
import { findMember, findMemberByKey } from '~/util/model.server';
|
||||
// import { miniSearch } from '~/util/search';
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
const pkgs = (
|
||||
@@ -193,16 +192,19 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
|
||||
containerKey = ApiFunction.getContainerKey(name, Number.parseInt(overloadIndex, 10));
|
||||
}
|
||||
|
||||
const members = pkg
|
||||
? getMembers(pkg, branchName).filter((item) => item.overloadIndex === null || item.overloadIndex <= 1)
|
||||
: [];
|
||||
const member =
|
||||
memberName && containerKey ? findMemberByKey(model, packageName, containerKey, branchName) ?? null : null;
|
||||
|
||||
return {
|
||||
props: {
|
||||
packageName,
|
||||
branchName,
|
||||
data: {
|
||||
members: pkg
|
||||
? getMembers(pkg, branchName).filter((item) => item.overloadIndex === null || item.overloadIndex <= 1)
|
||||
: [],
|
||||
member:
|
||||
memberName && containerKey ? findMemberByKey(model, packageName, containerKey, branchName) ?? null : null,
|
||||
members,
|
||||
member,
|
||||
source: mdxSource,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
type ApiPackage,
|
||||
type ApiItem,
|
||||
ApiItemKind,
|
||||
ApiDocumentedItem,
|
||||
type Excerpt,
|
||||
ExcerptTokenKind,
|
||||
ApiNameMixin,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
type ExcerptToken,
|
||||
type Parameter,
|
||||
type ApiFunction,
|
||||
ApiDeclaredItem,
|
||||
} from '@microsoft/api-extractor-model';
|
||||
import type { DocNode, DocParagraph, DocPlainText } from '@microsoft/tsdoc';
|
||||
import { type Meaning, ModuleSource } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
|
||||
@@ -58,8 +58,8 @@ export function generatePath(items: readonly ApiItem[], version: string) {
|
||||
return path.replace(/@discordjs\/(.*)\/(.*)?/, `$1/${version}/$2`);
|
||||
}
|
||||
|
||||
export function resolveDocComment(item: ApiDocumentedItem) {
|
||||
if (!(item instanceof ApiDocumentedItem)) {
|
||||
export function resolveDocComment(item: ApiDeclaredItem) {
|
||||
if (!(item instanceof ApiDeclaredItem)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export function createApiModel(data: any) {
|
||||
*
|
||||
* @param item - The API item to resolve the summary text for.
|
||||
*/
|
||||
function tryResolveSummaryText(item: ApiDeclaredItem): string | null {
|
||||
export function tryResolveSummaryText(item: ApiDeclaredItem): string | null {
|
||||
if (!item.tsdocComment) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user