mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 21:44:44 +12:00
fix: replace Object< with Record< (#9970)
This commit is contained in:
parent
cab60142ff
commit
0aa7dc1b86
1 changed files with 3 additions and 3 deletions
|
@ -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