From 8bc5b3a5bf20149a6ae569e918cb721725df2bd3 Mon Sep 17 00:00:00 2001 From: Daniel Knights <59598622+Daniel-Knights@users.noreply.github.com> Date: Tue, 10 Sep 2024 23:36:00 +0100 Subject: [PATCH] Fix typedef regex to allow typedefs without contraints --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d9e8174..88f111f 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ if (!fs.existsSync(moduleRootAbsolute)) { const importRegEx = /import\(["']([^"']*)["']\)(?:\.([^ \.\|\}><,\)=#\n]*))?([ \.\|\}><,\)=#\n])/g; -const typedefRegEx = /@typedef \{[^\}]*\} (\S+)/g; +const typedefRegEx = /@typedef\s*(?:\{[^\}]*\}\s*)?([^\{\}\s]+)/g; const noClassdescRegEx = /@(typedef|module|type)/; const extensionReplaceRegEx = /\.m?js$/; const slashRegEx = /\\/g;