Hello, community. I need to convert an object to the parameter string for a URL like this:
Entry object:
var obj = { a: 4, b: { c:5, d: { e: 33, f:13 }, g:1 }, h: [1,2] };
Parameter line on output:
a=4&b[c]=5&b[d][e]=33&b[d][f]=13&b[g]=1&h[]=1&h[]=2
Parameter string in a more readable form for comparison with the source object:
a=4 & b[c]=5 & b[d][e]=33 & b[d][f]=13 & b[g]=1 & h[]=1 & h[]=2
I am writing a program on Node.JS. If you know such a function, or a package with such a function, or wrote it yourself, share it. Thank you in advance.