Skip to content

Commit

Permalink
[Docs] Don't show copyright/flow on APIs without docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Vatne committed May 10, 2015
1 parent 0206ab2 commit 120c32c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions website/jsdocs/jsdocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 120c32c

Please sign in to comment.