mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-16 07:17:35 +12:00
fix: replace Object< with Record< (#9970)
This commit is contained in:
parent
cab60142ff
commit
0aa7dc1b86
|
@ -219,12 +219,12 @@ function filePathFromJson(meta: DocgenMetaJson): string {
|
|||
return `${meta.path.slice('packages/discord.js/'.length)}/${meta.file}`;
|
||||
}
|
||||
|
||||
function fixPrimitiveTypes(type: string) {
|
||||
function fixPrimitiveTypes(type: string, symbol: string | undefined) {
|
||||
switch (type) {
|
||||
case '*':
|
||||
return 'any';
|
||||
case 'Object':
|
||||
return 'object';
|
||||
return symbol === '<' ? 'Record' : 'object';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
|
@ -1682,7 +1682,7 @@ export class ApiModelGenerator {
|
|||
...arr,
|
||||
{
|
||||
kind: type?.includes("'") ? ExcerptTokenKind.Content : ExcerptTokenKind.Reference,
|
||||
text: fixPrimitiveTypes(type ?? 'unknown'),
|
||||
text: fixPrimitiveTypes(type ?? 'unknown', symbol),
|
||||
canonicalReference: type?.includes("'")
|
||||
? undefined
|
||||
: DeclarationReference.package(this._apiModel.packages[0]!.name)
|
||||
|
|
Loading…
Reference in a new issue