File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,13 @@ export default class UnresolvedTypesMapper {
106106 // otherwise, do nothing, mapped already contains filtered list
107107
108108 // get unique list of types from remapped types
109- mapped = mapped . filter ( ( type , index , array ) => array . findIndex ( item => type . equals ( item ) ) === index ) ;
109+ const unique : Type [ ] = [ ] ;
110+ mapped . forEach ( item => {
111+ if ( ! unique . find ( type => this . equalsWorkaround ( item , type ) ) ) {
112+ unique . push ( item ) ;
113+ }
114+ } ) ;
115+ mapped = unique ;
110116
111117 if ( mapped . length === 1 ) {
112118 return mapped [ 0 ] ;
@@ -140,4 +146,12 @@ export default class UnresolvedTypesMapper {
140146 private getReflectionsByInstanceType < T extends Reflection > ( project : ProjectReflection , func : { new ( ...args : any [ ] ) : T } ) : T [ ] {
141147 return Object . values ( project . reflections ) . filter ( r => r instanceof func ) as unknown as T [ ] ;
142148 }
149+
150+ private equalsWorkaround ( type1 : Type , type2 : Type ) : boolean {
151+ return type1 . equals ( type2 )
152+ && (
153+ type1 instanceof ReferenceType && type2 instanceof ReferenceType
154+ && ( ( type1 . reflection ?? type1 . symbolFullyQualifiedName ) === ( type2 . reflection ?? type2 . symbolFullyQualifiedName ) )
155+ ) ;
156+ }
143157}
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ declare namespace Types {
77 parameters : { param1 : string , param2 : string } ;
88 items : [ ] ;
99 }
10+
11+ type rootNode = HTMLElement | ShadowRoot ;
1012}
You can’t perform that action at this time.
0 commit comments