mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 22:24:45 +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}`;
|
return `${meta.path.slice('packages/discord.js/'.length)}/${meta.file}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixPrimitiveTypes(type: string) {
|
function fixPrimitiveTypes(type: string, symbol: string | undefined) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case '*':
|
case '*':
|
||||||
return 'any';
|
return 'any';
|
||||||
case 'Object':
|
case 'Object':
|
||||||
return 'object';
|
return symbol === '<' ? 'Record' : 'object';
|
||||||
default:
|
default:
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -1682,7 +1682,7 @@ export class ApiModelGenerator {
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
kind: type?.includes("'") ? ExcerptTokenKind.Content : ExcerptTokenKind.Reference,
|
kind: type?.includes("'") ? ExcerptTokenKind.Content : ExcerptTokenKind.Reference,
|
||||||
text: fixPrimitiveTypes(type ?? 'unknown'),
|
text: fixPrimitiveTypes(type ?? 'unknown', symbol),
|
||||||
canonicalReference: type?.includes("'")
|
canonicalReference: type?.includes("'")
|
||||||
? undefined
|
? undefined
|
||||||
: DeclarationReference.package(this._apiModel.packages[0]!.name)
|
: DeclarationReference.package(this._apiModel.packages[0]!.name)
|
||||||
|
|
Loading…
Reference in a new issue