mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
fix: Ensure returns for function type definitions (#8346)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import type { Type } from './index.js';
|
import type { Type } from './index.js';
|
||||||
|
|
||||||
export interface VarType extends Type {
|
export interface VarType extends Type {
|
||||||
|
type?: Required<Type>;
|
||||||
description?: string;
|
description?: string;
|
||||||
nullable?: boolean;
|
nullable?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export class DocumentedVarType extends DocumentedItem<VarType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = this.data;
|
const data = this.data;
|
||||||
const names = data.names?.map((name) => splitVarName(name));
|
const names = (data.names ?? data.type?.names)?.map((name) => splitVarName(name));
|
||||||
|
|
||||||
if (!data.description && !data.nullable) {
|
if (!data.description && !data.nullable) {
|
||||||
return names;
|
return names;
|
||||||
|
|||||||
Reference in New Issue
Block a user