Skip to content

Commit 1603bc6

Browse files
committed
Simplifications
1 parent 74b9bd4 commit 1603bc6

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ module.exports = function (indexes, options, callback) {
5151

5252
return inputStream.pipe(concat(function (inputs) {
5353
try {
54-
55-
var docs = inputs
54+
callback(null, inputs
5655
.filter(filterJS)
5756
.reduce(function (memo, file) {
5857
return memo.concat(parse(file));
@@ -66,9 +65,7 @@ module.exports = function (indexes, options, callback) {
6665
return comment;
6766
})
6867
.sort(sort.bind(undefined, options.order))
69-
.filter(filterAccess.bind(undefined, options.private ? [] : undefined));
70-
71-
callback(null, docs);
68+
.filter(filterAccess.bind(undefined, options.private ? [] : undefined)));
7269
} catch (e) {
7370
callback(e);
7471
}

lib/parse.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ module.exports = function (comment, loc, context) {
3333
result.errors = [];
3434

3535
var i = 0;
36-
var errors = [];
3736
while (i < result.tags.length) {
3837
var tag = result.tags[i];
3938
if (tag.errors) {
@@ -46,11 +45,5 @@ module.exports = function (comment, loc, context) {
4645
}
4746
}
4847

49-
result = flatten(normalize(result));
50-
51-
if (errors.length) {
52-
result.errors = errors;
53-
}
54-
55-
return result;
48+
return flatten(normalize(result));
5649
};

0 commit comments

Comments
 (0)