mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
23 lines
550 B
JavaScript
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);
|
|
}
|
|
});
|
|
};
|