File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,17 @@ let DOCBLOCK_HEADER = /^\*\s/;
3131 */
3232export function getDocblock ( path : NodePath ) : ?string {
3333 var comments = [ ] ;
34- if ( path . node . comments ) {
34+ if ( path . node . leadingComments ) {
35+ comments = path . node . leadingComments . filter (
36+ comment => comment . type === 'CommentBlock' &&
37+ DOCBLOCK_HEADER . test ( comment . value )
38+ ) ;
39+ } else if ( path . node . comments ) {
3540 comments = path . node . comments . filter (
3641 comment => comment . leading &&
3742 comment . type === 'CommentBlock' &&
3843 DOCBLOCK_HEADER . test ( comment . value )
3944 ) ;
40- } else if ( path . node . leadingComments ) {
41- comments = path . node . leadingComments . filter (
42- comment => comment . type === 'CommentBlock' &&
43- DOCBLOCK_HEADER . test ( comment . value )
44- ) ;
4545 }
4646
4747 if ( comments . length > 0 ) {
You can’t perform that action at this time.
0 commit comments