Skip to content

Commit b46e436

Browse files
committed
fixed problem with event links
1 parent bda4f5a commit b46e436

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
1717
}
1818

1919
const importRegEx = /import\(["']([^"']*)["']\)\.([^ \.\|\}><,\)=#\n]*)([ \.\|\}><,\)=#\n])/g;
20-
const typedefRegEx = /@typedef \{[^\}]*\} (\S*)/;
20+
const typedefRegEx = /@typedef \{[^\}]*\} (\S+)/;
2121
const noClassdescRegEx = /@(typedef|module|type)/;
2222
const 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

Comments
 (0)