@@ -17,7 +17,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
1717}
1818
1919const importRegEx = / i m p o r t \( [ " ' ] ( [ ^ " ' ] * ) [ " ' ] \) \. ( [ ^ \. \| \} > < , \) = # \n ] * ) ( [ \. \| \} > < , \) = # \n ] ) / g;
20- const typedefRegEx = / @ t y p e d e f \{ [ ^ \} ] * \} ( \S * ) / ;
20+ const typedefRegEx = / @ t y p e d e f \{ [ ^ \} ] * \} ( \S + ) / ;
2121const noClassdescRegEx = / @ ( t y p e d e f | m o d u l e | t y p e ) / ;
2222const slashRegEx = / \\ / g;
2323
@@ -190,7 +190,7 @@ exports.astNodeVisitor = {
190190 }
191191
192192 // Treat `@typedef`s like named exports
193- const typedefMatch = comment . value . replace ( / \r ? \n ? \ s* \* \s / g, ' ' ) . match ( typedefRegEx ) ;
193+ const typedefMatch = comment . value . replace ( / \s * \* \s * / g, ' ' ) . match ( typedefRegEx ) ;
194194 if ( typedefMatch ) {
195195 identifiers [ typedefMatch [ 1 ] ] = {
196196 value : path . basename ( currentSourceName )
@@ -201,7 +201,7 @@ exports.astNodeVisitor = {
201201 node . comments . forEach ( comment => {
202202 // Replace local types with the full `module:` path
203203 Object . keys ( identifiers ) . forEach ( key => {
204- const regex = new RegExp ( `@(event |fires |.*[\{<\ |,] ?!?)${ key } ([}>|,\s])` , 'g' ) ;
204+ const regex = new RegExp ( `@(event |fires |.*[{< |,] ?!?)${ key } ([}>|,\ \s])` , 'g' ) ;
205205
206206 if ( regex . test ( comment . value ) ) {
207207 const identifier = identifiers [ key ] ;
0 commit comments