-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bac4c5b
commit 862546d
Showing
4 changed files
with
80 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
'use strict'; | ||
|
||
var walk = require('./walk'); | ||
|
||
/** | ||
* 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. | ||
* @param {Object} comment a parsed comment | ||
* @return {boolean} whether the comment should be output | ||
* @param {Array<string>} [levels=['private']] excluded access levels. | ||
* @param {Array<Object>} comments parsed comments (can be nested) | ||
* @return {Array<Object>} filtered comments | ||
*/ | ||
module.exports = function (levels, comment) { | ||
module.exports = function (levels, comments) { | ||
levels = levels || ['private']; | ||
return levels.indexOf(comment.access) === -1; | ||
|
||
function filter(comment) { | ||
return levels.indexOf(comment.access) === -1; | ||
} | ||
|
||
function recurse(comment) { | ||
for (var scope in comment.members) { | ||
comment.members[scope] = comment.members[scope].filter(filter); | ||
} | ||
} | ||
|
||
return walk(comments.filter(filter), recurse); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters