
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
query-string-object
Advanced tools
support object or array like php did: ?a[]=1&a[]=2 -> a=[1,2]
###Usage
install in shell
npm install query-string-object
in js file
qs = require('query-string-object')
qs('xx=yy&zz..') // just like what is pass to the native qs.parse
qs.stringify({
fInt: 1,
fString: 'string',
fObject: {
anobject: {a:1, b:2},
anything: 'thing'
},
fArray: [1,2,"string"]
})
// fInt=1&fString=string&fObject[anobject][a]=1&fObject[anobject][b]=2&fObject[anything]=thing&fArray[]=1&fArray[]=2&fArray[]=string
###Tests
npm install
./node_modules/.bin/mocha --reporter tap test.js
###Expects
####a=1&b=2
output
{
a:1,
b:2
}
####a=1&b[]=1&b[]=2&c=3
output
({
a: 1,
b: [1, 2],
c: 3
});
####a=1&b[]=1&c=3
output
({
a: 1,
b: [1],
c: 3
});
####a=1&b[1]=1&c[3]=2&c=3
output
({
a: 1,
b: {
1: 1
},
c: {
3: 2
}
});
####a=1&b[eric]=dum&c[stive]=jobs&c=3
output
({
a: 1,
b: {
eric: "dum"
},
c: {
stive: "jobs"
}
});
####a=1&b[eric]=dum&b[stive]=jobs&c=3
output
({
a: 1,
b: {
eric: "dum",
stive: "jobs"
},
c: 3
});
####a=1&b[eric][]=dum&b[stive][]=jobs&b[stive][]=fans&c=3
output
({
a: 1,
b: {
eric: ["dum"],
stive: ["jobs", "fans"]
},
c: 3
});
FAQs
support object or array like php did: ?a[]=1&a[]=2 -> a=[1,2]
We found that query-string-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.