Skip to content

Commit 976c7f8

Browse files
committed
Use filter-access for filtering access
1 parent 3f50786 commit 976c7f8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"hat": "0.0.3",
3535
"highlight.js": "^8.4.0",
3636
"jsdoc-inline-lex": "^1.0.1",
37+
"map-stream": "0.0.5",
3738
"micromatch": "^2.1.6",
3839
"module-deps": "^3.7.3",
3940
"queue-async": "^1.0.7",

streams/filter_access.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var through = require('through');
3+
var mapStream = require('map-stream');
44

55
/**
66
* Exclude given access levels from the generated documentation: this allows
@@ -14,9 +14,11 @@ var through = require('through');
1414
*/
1515
module.exports = function (levels) {
1616
levels = levels || ['private'];
17-
return through(function (comment) {
17+
return mapStream(function (comment, callback) {
1818
if (levels.indexOf(comment.access) === -1) {
19-
this.push(comment);
19+
callback(null, comment);
20+
} else {
21+
callback();
2022
}
2123
});
2224
};

0 commit comments

Comments
 (0)