File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,17 @@ for (const file of glob.sync("build/**/*.js")) {
54
54
let count = 0 ;
55
55
for ( let i = 0 , n = lines . length ; i < n ; ++ i ) {
56
56
let match : RegExpExecArray | null ;
57
- if ( ( match = / ^ \ /\* \* \s + @ j s d o c \s + ( \w + ) \s + \* \/ $ / . exec ( lines [ i ] ) ) ) {
58
- const [ , name ] = match ;
57
+ if ( ( match = / ^ ( \s * (?: \ /\* ) ? \* \s + ) @ j s d o c \s + ( \w + ) ( (?: \s * \* \/ ) ? \s * ) $ / . exec ( lines [ i ] ) ) ) {
58
+ const [ , pre , name , post ] = match ;
59
59
const docs = docmap . get ( name ) ;
60
60
if ( ! docs ) throw new Error ( `missing @jsdoc definition: ${ name } ` ) ;
61
61
if ( ! unused . has ( name ) ) throw new Error ( `duplicate @jsdoc reference: ${ name } ` ) ;
62
62
unused . delete ( name ) ;
63
63
++ count ;
64
64
lines [ i ] = docs
65
- . map ( ( line , i , lines ) => ( i === 0 ? `/** ${ line } ` : i === lines . length - 1 ? ` * ${ line } \n */` : ` * ${ line } ` ) )
65
+ . map ( ( line , i , lines ) =>
66
+ i === 0 ? `${ pre } ${ line } ` : i === lines . length - 1 ? ` * ${ line } ${ post ? `\n${ post } ` : "" } ` : ` * ${ line } `
67
+ )
66
68
. join ( "\n" ) ;
67
69
}
68
70
}
You can’t perform that action at this time.
0 commit comments