Merge branch 'feat/urldecode-pretty' into 'rewrite'

fix(modules/misc/urldecode): quote values and add 'params ='

See merge request Cynosphere/HiddenPhox!25
This commit is contained in:
Cynthia Foxwell 2025-07-13 13:26:46 -06:00
commit 48e16c3988

View file

@ -21,10 +21,10 @@ urldecode.callback = async function (msg, line, [urlString]) {
return `\`\`\`py
${info
.filter((kv) => kv[1].length > 0)
.map(([k, v]) => `${k} = ${v}`)
.map(([k, v]) => `${k} = ${JSON.stringify(v)}`)
.join("\n")}
${JSON.stringify(
params = ${JSON.stringify(
url.searchParams,
(_, v) => (v instanceof URLSearchParams ? Object.fromEntries(v.entries()) : v),
"\t"