title: window.location.href.replace is giving no overload matches call
body: <p>Hi I inherited some uncommented code that I'm having a hard time figuring out where it originated.  It appears to have a simple bug, but I cannot figure out what it is.  The token is not being assigned a value, and VS Code is reporting an error with the typescript.</p>
  <p>Here is the code:</p>
  <pre><code>let token = ''
        window.location.href.replace(/[?&amp;]+([^=&amp;]+)=([^&amp;]*)/gi, (m, key, value) =&gt; {
          if (key === 'token') token = value
        })
  </code></pre>
  <p>VS Code is reporting the following:</p>
  <p>No overload matches this call.
  The last overload gave the following error.
  Argument of type '(m: string, key: any, value: any) =&gt; void' is not assignable to parameter of type '(substring: string, ...args: any[]) =&gt; string'.
  Type 'void' is not assignable to type 'string'.ts(2769)
  lib.es5.d.ts(456, 5): The last overload is declared here.</p>