Skip to content

Commit 0aa7dc1

Browse files
authored
fix: replace Object< with Record< (#9970)
1 parent cab6014 commit 0aa7dc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/api-extractor/src/generators/ApiModelGenerator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ function filePathFromJson(meta: DocgenMetaJson): string {
219219
return `${meta.path.slice('packages/discord.js/'.length)}/${meta.file}`;
220220
}
221221

222-
function fixPrimitiveTypes(type: string) {
222+
function fixPrimitiveTypes(type: string, symbol: string | undefined) {
223223
switch (type) {
224224
case '*':
225225
return 'any';
226226
case 'Object':
227-
return 'object';
227+
return symbol === '<' ? 'Record' : 'object';
228228
default:
229229
return type;
230230
}
@@ -1682,7 +1682,7 @@ export class ApiModelGenerator {
16821682
...arr,
16831683
{
16841684
kind: type?.includes("'") ? ExcerptTokenKind.Content : ExcerptTokenKind.Reference,
1685-
text: fixPrimitiveTypes(type ?? 'unknown'),
1685+
text: fixPrimitiveTypes(type ?? 'unknown', symbol),
16861686
canonicalReference: type?.includes("'")
16871687
? undefined
16881688
: DeclarationReference.package(this._apiModel.packages[0]!.name)

0 commit comments

Comments
 (0)