documentation/streams/filter_access.js
2015-04-09 15:15:39 -07:00

23 lines
550 B
JavaScript

'use strict';
var through = require('through');
/**
* Exclude given access levels from the generated documentation: this allows
* users to write documentation for non-public members by using the
* `@private` tag.
*
* @name access
* @public
* @param {Array<String>} [levels=[private]] excluded access levels.
* @return {stream.Transform}
*/
module.exports = function (levels) {
levels = levels || ['private'];
return through(function (comment) {
if (levels.indexOf(comment.access) === -1) {
this.push(comment);
}
});
};