I just read the function and was a bit confused about what "parameters" mean here.
I first believed those were regular URL GET parameters like "?abc=1&def=2" but from reading the example below I saw that it's rather in-URL parameters like "/some/path/{param1}/{param2}/".
So to prevent confusion it might be good to document this properly.

Also, a JS unit test for that function might be good since now we don't depend on server routes any more. But we can add it later as you seem to have numerous backports already.