File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 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")) {
5454 let count = 0 ;
5555 for ( let i = 0 , n = lines . length ; i < n ; ++ i ) {
5656 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 ;
5959 const docs = docmap . get ( name ) ;
6060 if ( ! docs ) throw new Error ( `missing @jsdoc definition: ${ name } ` ) ;
6161 if ( ! unused . has ( name ) ) throw new Error ( `duplicate @jsdoc reference: ${ name } ` ) ;
6262 unused . delete ( name ) ;
6363 ++ count ;
6464 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+ )
6668 . join ( "\n" ) ;
6769 }
6870 }
You can’t perform that action at this time.
0 commit comments