@@ -26,16 +26,16 @@ export class TypePlugin extends ConverterComponent {
26
26
this . onResolveEnd . bind ( this ) ,
27
27
) ;
28
28
this . owner . on ( ConverterEvents . END , ( ) => this . reflections . clear ( ) ) ;
29
- this . application . on ( ApplicationEvents . REVIVE , this . onRevive . bind ( this ) ) ;
29
+ this . application . on (
30
+ ApplicationEvents . REVIVE ,
31
+ this . onRevive . bind ( this ) ,
32
+ 100 ,
33
+ ) ;
30
34
}
31
35
32
36
private onRevive ( project : ProjectReflection ) {
33
37
for ( const id in project . reflections ) {
34
- this . resolve (
35
- project ,
36
- project . reflections [ id ] ,
37
- /* create links */ false ,
38
- ) ;
38
+ this . resolve ( project , project . reflections [ id ] ) ;
39
39
}
40
40
this . finishResolve ( project ) ;
41
41
this . reflections . clear ( ) ;
@@ -45,11 +45,7 @@ export class TypePlugin extends ConverterComponent {
45
45
this . resolve ( context . project , reflection ) ;
46
46
}
47
47
48
- private resolve (
49
- project : ProjectReflection ,
50
- reflection : Reflection ,
51
- createLinks = true ,
52
- ) {
48
+ private resolve ( project : ProjectReflection , reflection : Reflection ) {
53
49
if ( ! ( reflection instanceof DeclarationReflection ) ) return ;
54
50
55
51
if ( reflection . kindOf ( ReflectionKind . ClassOrInterface ) ) {
@@ -58,7 +54,12 @@ export class TypePlugin extends ConverterComponent {
58
54
walk ( reflection . implementedTypes , ( target ) => {
59
55
this . postpone ( target ) ;
60
56
target . implementedBy ||= [ ] ;
61
- if ( createLinks ) {
57
+
58
+ if (
59
+ ! target . implementedBy . some (
60
+ ( t ) => t . reflection === reflection ,
61
+ )
62
+ ) {
62
63
target . implementedBy . push (
63
64
ReferenceType . createResolvedReference (
64
65
reflection . name ,
@@ -73,7 +74,9 @@ export class TypePlugin extends ConverterComponent {
73
74
this . postpone ( target ) ;
74
75
target . extendedBy ||= [ ] ;
75
76
76
- if ( createLinks ) {
77
+ if (
78
+ ! target . extendedBy . some ( ( t ) => t . reflection === reflection )
79
+ ) {
77
80
target . extendedBy . push (
78
81
ReferenceType . createResolvedReference (
79
82
reflection . name ,
0 commit comments