queryToObject
Parses a query string into an object, where the keys and values of the object are the name/value pairs from the query string, decoded. If a name appears multiple times, the value in the object will be an array of values.
const obj = queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
// obj will be:
// {
// key1 : 'some value',
// key2 : 'a/b',
// key3 : ['x', 'y']
// }
Content copied to clipboard
Return
An object containing the parameters parsed from the query string.
Parameters
queryString
The query string.