From: Ardis Lu Date: Sun, 19 Mar 2023 05:04:04 +0000 (-0700) Subject: Make function prefix optional X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=457150f1755d60eeb5b90a0d8222df14306783c3;p=4-byte-gen Make function prefix optional --- diff --git a/index.html b/index.html index 6cf4740..e40dbaf 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@ // Extract the function name and parameters // Original regex is from wagmi-dev/abitype // https://github.com/wagmi-dev/abitype/blob/main/src/human-readable/runtime/signatures.ts#L31 - const functionRegex = /^function (?[a-zA-Z0-9_]+)\((?.*?)\)/; + const functionRegex = /^(function )?(?[a-zA-Z0-9_]+)\((?.*?)\)/; const { name, parameters } = functionRegex.exec(fn).groups; // Drop parameter names and extraneous whitespace, if there are any