fix: Ensure returns for function type definitions (#8346)

This commit is contained in:
Jiralite
2022-07-24 12:44:46 +01:00
committed by GitHub
parent af837debe3
commit 59a7e52224
2 changed files with 2 additions and 1 deletions

View File

@@ -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;
} }

View File

@@ -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;