From bad26e3bb1d6d5769c4f0203cf84e2040bc978a2 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 10 Feb 2024 17:57:00 -0800 Subject: [PATCH] Parse functions with space between identifier and parenthesis --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 16c61ca..667663f 100644 --- a/index.html +++ b/index.html @@ -454,11 +454,11 @@ // "... returns ()", then all keywords up until the last "returns" type is included in params. let functionRegex; if (strict) { - functionRegex = /^(function )(?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)(?!.+\))/; + functionRegex = /^(function )(?[a-zA-Z$_][a-zA-Z0-9$_]*) *\((?.*?)(?!.+\))/; } else { fn = fn.replaceAll(/[;'"]/g, ''); // Clean all characters that definitely do not affect the signature - functionRegex = /^(function )?(?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)(?!.+\))/; + functionRegex = /^(function )?(?[a-zA-Z$_][a-zA-Z0-9$_]*) *\((?.*?)(?!.+\))/; } const { name, parameters } = functionRegex.exec(fn).groups; -- 2.47.3