Socket
Socket
Sign inDemoInstall

qs

Package Overview
Dependencies
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

17

lib/stringify.js

@@ -11,4 +11,12 @@ // Load modules

if (Buffer.isBuffer(obj)) {
obj = obj.toString();
}
else if (obj instanceof Date) {
obj = obj.toISOString();
}
if (typeof obj === 'string' ||
typeof obj === 'number') {
typeof obj === 'number' ||
typeof obj === 'boolean') {

@@ -37,7 +45,6 @@ return [prefix + '=' + encodeURIComponent(obj)];

var keys = [];
var value = JSON.parse(JSON.stringify(obj));
for (var key in value) {
if (value.hasOwnProperty(key)) {
keys = keys.concat(internals.stringify(value[key], encodeURIComponent(key)));
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys = keys.concat(internals.stringify(obj[key], encodeURIComponent(key)));
}

@@ -44,0 +51,0 @@ }

{
"name": "qs",
"version": "1.0.0",
"version": "1.0.1",
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
"homepage": "https://github.com/hapijs/qs",
"main": "index.js",
"dependencies": {
},
"dependencies": {},
"devDependencies": {

@@ -10,0 +9,0 @@ "lab": "3.x.x"

@@ -107,2 +107,18 @@ // Load modules

});
it('stringifies boolean values', function (done) {
expect(Qs.stringify({ a: true })).to.equal('a=true');
expect(Qs.stringify({ a: { b: true } })).to.equal('a[b]=true');
expect(Qs.stringify({ b: false })).to.equal('b=false');
expect(Qs.stringify({ b: { c: false } })).to.equal('b[c]=false');
done();
});
it('stringifies buffer values', function (done) {
expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a[b]=test');
done();
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc