I am trying to convert my parameters into a string in order to send an api request. However, my current function replaces the spaces in the parameters into '%20'. How do I change it to change spaces into +?
Example params: {name: "joe walsh"}
Current result: ...endpoint?name=joe%20walsh
Wanted result: ...endpoint?name=joe+walsh
Here's my current function
stringifyParams(params: any) {
return queryString
.stringify(params)
.replace(/[^?=&]+=(&|$)/g, '')
.replace(/&$/, '')
}