]> git.ardis.lu - 4-byte-gen/commitdiff
Make function prefix optional
authorArdis Lu <ardisglu@gmail.com>
Sun, 19 Mar 2023 05:04:04 +0000 (22:04 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 19 Mar 2023 05:04:04 +0000 (22:04 -0700)
index.html

index 6cf47405582094f0f2d1a8fb77e88b02f16866d7..e40dbaf1274d2cba8cbc2cd9f83fc19650372606 100644 (file)
@@ -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 (?<name>[a-zA-Z0-9_]+)\((?<parameters>.*?)\)/;
+      const functionRegex = /^(function )?(?<name>[a-zA-Z0-9_]+)\((?<parameters>.*?)\)/;
       const { name, parameters } = functionRegex.exec(fn).groups;
 
       // Drop parameter names and extraneous whitespace, if there are any
This page took 0.045238 seconds and 4 git commands to generate.