Skip to content

Commit e17b481

Browse files
committed
Use Boolean trick for Markdown AST as well
1 parent 5c62d23 commit e17b481

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/output/markdown_ast.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ var mdast = require('mdast'),
33
formatType = require('../markdown_format_type'),
44
formatInlineTags = require('../format_inline_tags');
55

6-
function identity(x) {
7-
return x;
8-
}
9-
106
/**
117
* Given a hierarchy-nested set of comments, generate an mdast-compatible
128
* Abstract Syntax Usable for generating Markdown output
@@ -43,7 +39,7 @@ function commentsToAST(comments, opts, callback) {
4339
u('text', ')')
4440
]),
4541
param.properties && paramList(param.properties)
46-
].filter(identity))
42+
].filter(Boolean))
4743
]);
4844
}));
4945
}
@@ -68,7 +64,7 @@ function commentsToAST(comments, opts, callback) {
6864
u('text', ' '),
6965
mdast.parse(formatInlineTags(property.description))
7066
])
71-
].filter(identity))
67+
].filter(Boolean))
7268
}))
7369
]);
7470
}
@@ -104,7 +100,7 @@ function commentsToAST(comments, opts, callback) {
104100
u('root', comment.members.instance.map(generate.bind(null, depth + 1))),
105101
!!comment.members.static.length &&
106102
u('root', comment.members.static.map(generate.bind(null, depth + 1)))
107-
].filter(identity));
103+
].filter(Boolean));
108104
}
109105

110106
return callback(null, u('root', comments.map(function (comment) {

0 commit comments

Comments
 (0)