File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,8 @@ export const typify = (
255
255
// we'll have to qualify it with the Node.js namespace.
256
256
return 'NodeJS.ReadableStream' ;
257
257
}
258
+ // Custom type
259
+ if ( innerTypes ) return `${ typeAsString } <${ typify ( innerTypes [ 0 ] ) } >` ;
258
260
return typeAsString ;
259
261
} ;
260
262
export const paramify = ( paramName : string ) => {
Original file line number Diff line number Diff line change @@ -102,6 +102,21 @@ describe('utils', () => {
102
102
it ( 'should map node objects to the correct type' , ( ) => {
103
103
expect ( utils . typify ( 'buffer' ) ) . toEqual ( 'Buffer' ) ;
104
104
} ) ;
105
+
106
+ it ( 'should convert custom types with inner types' , ( ) => {
107
+ expect (
108
+ utils . typify ( {
109
+ collection : false ,
110
+ innerTypes : [
111
+ {
112
+ collection : false ,
113
+ type : 'T' ,
114
+ } ,
115
+ ] ,
116
+ type : 'Foo' ,
117
+ } ) ,
118
+ ) . toEqual ( 'Foo<T>' ) ;
119
+ } ) ;
105
120
} ) ;
106
121
107
122
describe ( 'paramify' , ( ) => {
You can’t perform that action at this time.
0 commit comments