Skip to content

Commit a597741

Browse files
committed
Add @ignore support
1 parent 40af716 commit a597741

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

lib/filter_access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function filterAccess(levels, comments) {
1515
levels = levels || ['public', 'undefined', 'protected'];
1616

1717
function filter(comment) {
18-
return levels.indexOf(String(comment.access)) !== -1;
18+
return !comment.ignore && levels.indexOf(String(comment.access)) !== -1;
1919
}
2020

2121
function recurse(comment) {

lib/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var flatteners = {
7070
result.scope = 'global';
7171
},
7272
'host': synonym('external'),
73-
// 'ignore'
73+
'ignore': flattenBoolean,
7474
// 'implements'
7575
// 'inheritdoc'
7676
'inner': function (result) {

test/lib/filter_access.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
var test = require('tap').test,
44
filterAccess = require('../../lib/filter_access');
55

6+
test('filterAccess ignore', function (t) {
7+
t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{
8+
access: 'public',
9+
ignore: true
10+
}]), []);
11+
t.end();
12+
});
13+
614
test('filterAccess public, protected, undefined, no private', function (t) {
715
t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{
816
access: 'public'

test/lib/parse.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@ test('parse - @host', function (t) {
238238
t.end();
239239
});
240240

241+
test('parse - @ignore', function (t) {
242+
t.equal(evaluate(function () {
243+
/** @ignore */
244+
})[0].ignore, true);
245+
246+
t.end();
247+
});
248+
241249
test('parse - @inner', function (t) {
242250
t.equal(evaluate(function () {
243251
/** @inner*/

0 commit comments

Comments
 (0)