Comparing version 1.0.0 to 1.0.1
@@ -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(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
23598
493
0