documentation/test/normalize.js
2016-04-26 13:43:18 -04:00

20 lines
483 B
JavaScript

var walk = require('../lib/walk'),
traverse = require('babel-traverse').default;
module.exports = function (comments) {
return walk(comments, function (comment) {
var hasGithub = !!comment.context.github;
var path = comment.context.path;
comment.context = {
loc: comment.context.loc,
code: comment.context.code
};
if (hasGithub) {
comment.context.github = '[github]';
}
if (path) {
comment.context.path = path;
}
});
};