@@ -857,12 +857,22 @@ export class Dependencies {
857
857
858
858
private visitInput ( property , inDecorator , sourceFile ?) {
859
859
var inArgs = inDecorator . expression . arguments ,
860
- _return = {
861
- name : inArgs . length ? inArgs [ 0 ] . text : property . name . text ,
862
- defaultValue : property . initializer ? this . stringifyDefaultValue ( property . initializer ) : undefined ,
863
- description : marked ( LinkParser . resolveLinks ( ts . displayPartsToString ( property . symbol . getDocumentationComment ( ) ) ) ) ,
864
- line : this . getPosition ( property , sourceFile ) . line + 1
865
- } ;
860
+ _return = { } ;
861
+ _return . name = ( inArgs . length > 0 ) ? inArgs [ 0 ] . text : property . name . text ;
862
+ _return . defaultValue = property . initializer ? this . stringifyDefaultValue ( property . initializer ) : undefined ;
863
+ if ( property . symbol ) {
864
+ _return . description = marked ( LinkParser . resolveLinks ( ts . displayPartsToString ( property . symbol . getDocumentationComment ( ) ) ) )
865
+ }
866
+ if ( ! _return . description ) {
867
+ if ( property . jsDoc ) {
868
+ if ( property . jsDoc . length > 0 ) {
869
+ if ( typeof property . jsDoc [ 0 ] . comment !== 'undefined' ) {
870
+ _return . description = marked ( property . jsDoc [ 0 ] . comment ) ;
871
+ }
872
+ }
873
+ }
874
+ }
875
+ _return . line = this . getPosition ( property , sourceFile ) . line + 1 ;
866
876
if ( property . type ) {
867
877
_return . type = this . visitType ( property ) ;
868
878
} else {
@@ -931,12 +941,24 @@ export class Dependencies {
931
941
}
932
942
933
943
private visitOutput ( property , outDecorator , sourceFile ?) {
934
- var outArgs = outDecorator . expression . arguments ,
935
- _return = {
936
- name : outArgs . length ? outArgs [ 0 ] . text : property . name . text ,
937
- description : marked ( LinkParser . resolveLinks ( ts . displayPartsToString ( property . symbol . getDocumentationComment ( ) ) ) ) ,
938
- line : this . getPosition ( property , sourceFile ) . line + 1
939
- } ;
944
+ var inArgs = outDecorator . expression . arguments ,
945
+ _return = { } ;
946
+ _return . name = ( inArgs . length > 0 ) ? inArgs [ 0 ] . text : property . name . text ;
947
+ _return . defaultValue = property . initializer ? this . stringifyDefaultValue ( property . initializer ) : undefined ;
948
+ if ( property . symbol ) {
949
+ _return . description = marked ( LinkParser . resolveLinks ( ts . displayPartsToString ( property . symbol . getDocumentationComment ( ) ) ) )
950
+ }
951
+ if ( ! _return . description ) {
952
+ if ( property . jsDoc ) {
953
+ if ( property . jsDoc . length > 0 ) {
954
+ if ( typeof property . jsDoc [ 0 ] . comment !== 'undefined' ) {
955
+ _return . description = marked ( property . jsDoc [ 0 ] . comment ) ;
956
+ }
957
+ }
958
+ }
959
+ }
960
+ _return . line = this . getPosition ( property , sourceFile ) . line + 1 ;
961
+
940
962
if ( property . type ) {
941
963
_return . type = this . visitType ( property ) ;
942
964
} else {
0 commit comments