mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(serializer): properly serialize data
This commit is contained in:
@@ -23,7 +23,7 @@ export class DocumentedConstructor extends DocumentedItem<Constructor | Declarat
|
||||
: undefined,
|
||||
// @ts-expect-error
|
||||
params: signature.parameters
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config).serialize())
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export class DocumentedEvent extends DocumentedItem<Event | DeclarationReflectio
|
||||
deprecated: signature.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||
// @ts-expect-error
|
||||
params: signature.parameters
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config).serialize())
|
||||
: undefined,
|
||||
meta,
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ export class DocumentedMethod extends DocumentedItem<Method | DeclarationReflect
|
||||
emits: signature.comment?.tags?.filter((t) => t.tagName === 'emits').map((t) => t.text.trim()),
|
||||
// @ts-expect-error
|
||||
params: signature.parameters
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config).serialize())
|
||||
: undefined,
|
||||
returns: signature.type
|
||||
? new DocumentedVarType(
|
||||
|
||||
@@ -18,8 +18,8 @@ export class DocumentedParam extends DocumentedItem<Param | ParameterReflection>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
data.comment?.tags?.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||
(data.defaultValue === '...' ? undefined : data.defaultValue),
|
||||
type: data.type ? new DocumentedVarType({ names: [parseType(data.type)] }, this.config).serialize() : undefined,
|
||||
variable: data.flags.isRest,
|
||||
type: data.type ? new DocumentedVarType({ names: [parseType(data.type)] }, this.config).serialize() : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user