Currently, I am utilizing querySelector from https://www.npmjs.com/package/qs with the objective of transforming an array into a comma-separated string.
The process involves beginning with a URL search string and parsing it using the `qs` library. Subsequently, I made an attempt to utilize the `qs` `stringify` method to generate the desired formatted string.
const sUrl = 'a=1&b=1&c=1&c=2&c=3';
const oData = qs.parse(sUrl);
// Upon executing oData, the returned object is:
{
a: 1,
b: 1,
c: ['1', '2', '3']
}
const sData = qs.stringify(oData);
// The resulting sUrl is: 'a=1&b=1&c%5B0%5D=1&c%5B1%5D=2&c%5B2%5D=3'
The intended output format is as follows:
a=1&b=1&c=1,2,3