blob: 905e15776ffd992fc3680c96aa444fda25445c0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
const path = require('path');
exports.handlers = {
jsdocCommentFound(e) {
var moduleName = path.parse(e.filename).name;
var lines = e.comment.split(/\r?\n/);
var importLines = [
'```',
`import ${moduleName} from 'async/${moduleName}';`,
'```'
];
if (moduleName !== 'index') {
e.comment = [lines[0], ...importLines, ...lines.slice(1)].join("\n");
}
}
};
|