@@ -17,7 +17,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
17
17
}
18
18
19
19
const 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 + ) / ;
21
21
const noClassdescRegEx = / @ ( t y p e d e f | m o d u l e | t y p e ) / ;
22
22
const slashRegEx = / \\ / g;
23
23
@@ -190,7 +190,7 @@ exports.astNodeVisitor = {
190
190
}
191
191
192
192
// 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 ) ;
194
194
if ( typedefMatch ) {
195
195
identifiers [ typedefMatch [ 1 ] ] = {
196
196
value : path . basename ( currentSourceName )
@@ -201,7 +201,7 @@ exports.astNodeVisitor = {
201
201
node . comments . forEach ( comment => {
202
202
// Replace local types with the full `module:` path
203
203
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' ) ;
205
205
206
206
if ( regex . test ( comment . value ) ) {
207
207
const identifier = identifiers [ key ] ;
0 commit comments