We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
typeArguments
ReferenceType#toString()
1 parent 75db29c commit 26fbd15Copy full SHA for 26fbd15
src/lib/models/types/reference.ts
@@ -113,12 +113,18 @@ export class ReferenceType extends Type
113
114
/**
115
* Return a string representation of this type.
116
+ * @example EventEmitter<any>
117
*/
118
toString() {
- if (this.reflection) {
119
- return this.reflection.name + (this.isArray ? '[]' : '');
120
- } else {
121
- return this.name + (this.isArray ? '[]' : '');
+ var name = this.reflection ? this.reflection.name : this.name;
+ var arraySuffix = this.isArray ? '[]' : '';
+ var typeArgs = '';
122
+ if (this.typeArguments) {
123
+ typeArgs += '<';
124
+ typeArgs += this.typeArguments.map(arg => arg.toString()).join(', ');
125
+ typeArgs += '>'
126
}
127
+
128
+ return name + typeArgs + arraySuffix;
129
130
0 commit comments