MCPcopy Index your code
hub / github.com/ClearURLs/Addon / urlSearchParamsToString

Function urlSearchParamsToString

core_js/tools.js:345–357  ·  view source on GitHub ↗

* Returns an URLSearchParams as string. * Does handle spaces correctly.

(searchParams)

Source from the content-addressed store, hash-verified

343 * Does handle spaces correctly.
344 */
345function urlSearchParamsToString(searchParams) {
346 const rtn = []
347
348 searchParams.forEach((value, key) => {
349 if (value) {
350 rtn.push(key + '=' + encodeURIComponent(value))
351 } else {
352 rtn.push(key)
353 }
354 })
355
356 return rtn.join('&')
357}

Callers 1

removeFieldsFormURLFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected