[Docs] Don't show copyright/flow on APIs without docblock
This commit is contained in:
parent
0206ab2bac
commit
120c32c52c
|
@ -105,10 +105,20 @@ function getFileDocBlock(commentsForFile) {
|
|||
commentsForFile.some(function(comment, i) {
|
||||
if (comment.loc.start.line === 1) {
|
||||
var lines = comment.value.split('\n');
|
||||
var inCopyrightBlock = false;
|
||||
var filteredLines = lines.filter(function(line) {
|
||||
var hasCopyright = !!line.match(/^\s*\*\s+Copyright/);
|
||||
if (!!line.match(/^\s*\*\s+Copyright \(c\)/)) {
|
||||
inCopyrightBlock = true;
|
||||
}
|
||||
|
||||
var hasProvides = !!line.match(/^\s*\*\s+@provides/);
|
||||
return !hasCopyright && !hasProvides;
|
||||
var hasFlow = !!line.match(/^\s*\*\s+@flow/);
|
||||
|
||||
if (hasFlow || hasProvides) {
|
||||
inCopyrightBlock = false;
|
||||
}
|
||||
|
||||
return !inCopyrightBlock && !hasFlow && !hasProvides;
|
||||
});
|
||||
docblock = filteredLines.join('\n');
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue