不要怂,就是干,撸起袖子干!

Commit f3805600 by Sascha Depold

Refactor tag name getter

1 parent edb7066c
Showing with 4 additions and 18 deletions
...@@ -52,25 +52,10 @@ Comment.prototype.hasTag = function(tagName) { ...@@ -52,25 +52,10 @@ Comment.prototype.hasTag = function(tagName) {
}; };
Comment.prototype.getName = function () { Comment.prototype.getName = function () {
var tag; var tag = (['name', 'class', 'property', 'method']).reduce(function (tag, tagName) {
return tag || this.getTag(tagName);
}.bind(this), null);
tag = this.getTag('name');
if (tag) {
return tag.string;
}
tag = this.getTag('class');
if (tag) {
return tag.string;
}
tag = this.getTag('property');
if (tag) {
return tag.string;
}
tag = this.getTag('method');
if (tag) { if (tag) {
return tag.string; return tag.string;
} }
...@@ -280,6 +265,7 @@ new git.Repo(path.dirname(__filename) + '/..', function (err, repo) { ...@@ -280,6 +265,7 @@ new git.Repo(path.dirname(__filename) + '/..', function (err, repo) {
fs.readFile(file.file, function (err, code) { fs.readFile(file.file, function (err, code) {
obj = dox.parseComments(code.toString(), { raw: true}); obj = dox.parseComments(code.toString(), { raw: true});
path = program.out + '/' + file.output + '.md'; path = program.out + '/' + file.output + '.md';
console.log(path) console.log(path)
var output = parseComments(obj, file.file); var output = parseComments(obj, file.file);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!