mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[JSDoc] Handle missing @constructor
WTD-1482
This commit is contained in:
parent
1558c9d1bd
commit
2f79323264
15
jsdocify.js
15
jsdocify.js
@ -31,7 +31,20 @@
|
||||
rewriter._transform = function (chunk, encoding, done) {
|
||||
var data = String(chunk);
|
||||
if (!reachedConstructor) {
|
||||
if (data.match(/^ *\* @constructor/)) {
|
||||
// First, check for constructors missing @constructor
|
||||
if (data.match(/^ *\*\//) && data.indexOf("*") > 3) {
|
||||
// Track position to detect inner methods
|
||||
starDepth = data.indexOf("*");
|
||||
reachedConstructor = true;
|
||||
// Add a @memberof <namespace> annotation
|
||||
this.push(spaces(starDepth) + "* @constructor\n");
|
||||
this.push([
|
||||
spaces(starDepth),
|
||||
"* @memberof ",
|
||||
bundleName(filename),
|
||||
"\n"
|
||||
].join(""));
|
||||
} else if (data.match(/^ *\* @constructor/)) {
|
||||
// Track position to detect inner methods
|
||||
starDepth = data.indexOf("*");
|
||||
reachedConstructor = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user