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/;
31
31
*/
32
32
export function getDocblock ( path : NodePath ) : ?string {
33
33
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 ) {
35
40
comments = path . node . comments . filter (
36
41
comment => comment . leading &&
37
42
comment . type === 'CommentBlock' &&
38
43
DOCBLOCK_HEADER . test ( comment . value )
39
44
) ;
40
- } else if ( path . node . leadingComments ) {
41
- comments = path . node . leadingComments . filter (
42
- comment => comment . type === 'CommentBlock' &&
43
- DOCBLOCK_HEADER . test ( comment . value )
44
- ) ;
45
45
}
46
46
47
47
if ( comments . length > 0 ) {
You can’t perform that action at this time.
0 commit comments