Let's say I have a URL that I want to parse, including the query string:
https://www.example.com/foo?bar=1&a[]=x&a[]=y
I would expect to be able to obtain a hash of the query string like:
{ "bar" => "1", "a" => ["x", "y"] }
How can I parse this using Opal? I looked at options like URI and even CGI from Ruby, but it seems they are unavailable.
Clearly, I could break apart this string myself (or possibly use the Addressable gem), but I would like to use some included library function instead.
hmdne on the Opal Slack has pointed me to
opal-browser
which includes theBrowser::FormData.parse_query(s)
method.