mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
refactor: reset state and code cleanup
This commit is contained in:
@@ -6,9 +6,7 @@ import { TSDoc } from './tsdoc/TSDoc';
|
||||
import type { ApiMethodJSON, ApiMethodSignatureJSON } from '~/DocModel/ApiNodeJSONEncoder';
|
||||
import { Visibility } from '~/DocModel/Visibility';
|
||||
|
||||
type MethodResolvable = ApiMethodJSON | ApiMethodSignatureJSON;
|
||||
|
||||
function getShorthandName(data: MethodResolvable) {
|
||||
function getShorthandName(data: ApiMethodJSON | ApiMethodSignatureJSON) {
|
||||
return `${data.name}${data.optional ? '?' : ''}(${data.parameters.reduce((prev, cur, index) => {
|
||||
if (index === 0) {
|
||||
return `${prev}${cur.isOptional ? `${cur.name}?` : cur.name}`;
|
||||
@@ -18,7 +16,7 @@ function getShorthandName(data: MethodResolvable) {
|
||||
}, '')})`;
|
||||
}
|
||||
|
||||
export function MethodItem({ data }: { data: MethodResolvable }) {
|
||||
export function MethodItem({ data }: { data: ApiMethodJSON | ApiMethodSignatureJSON }) {
|
||||
const method = data as ApiMethodJSON;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user