Skip to content

Commit 8bc5b3a

Browse files
Fix typedef regex to allow typedefs without contraints
1 parent 4116d7a commit 8bc5b3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
2727

2828
const importRegEx =
2929
/import\(["']([^"']*)["']\)(?:\.([^ \.\|\}><,\)=#\n]*))?([ \.\|\}><,\)=#\n])/g;
30-
const typedefRegEx = /@typedef \{[^\}]*\} (\S+)/g;
30+
const typedefRegEx = /@typedef\s*(?:\{[^\}]*\}\s*)?([^\{\}\s]+)/g;
3131
const noClassdescRegEx = /@(typedef|module|type)/;
3232
const extensionReplaceRegEx = /\.m?js$/;
3333
const slashRegEx = /\\/g;

0 commit comments

Comments
 (0)