Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qs

Package Overview
Dependencies
Maintainers
1
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 0.5.0 to 0.5.1

component.json

5

History.md
0.5.1 / 2012-09-18
==================
* fix encoded `=`. Closes #43
0.5.0 / 2012-05-04

@@ -3,0 +8,0 @@ ==================

24

lib/querystring.js

@@ -102,8 +102,2 @@

.reduce(function(ret, pair){
try{
pair = decodeURIComponent(pair.replace(/\+/g, ' '));
} catch(e) {
// ignore
}
var eql = pair.indexOf('=')

@@ -118,3 +112,3 @@ , brace = lastBraceInKey(pair)

return merge(ret, key, val);
return merge(ret, decode(key), decode(val));
}, { base: {} }).base;

@@ -255,1 +249,17 @@ }

}
/**
* Decode `str`.
*
* @param {String} str
* @return {String}
* @api private
*/
function decode(str) {
try {
return decodeURIComponent(str.replace(/\+/g, ' '));
} catch (err) {
return str;
}
}
{
"name": "qs",
"description": "querystring parser",
"version": "0.5.0",
"version": "0.5.1",
"keywords": ["query string", "parser", "component"],

@@ -6,0 +6,0 @@ "repository": {

@@ -31,5 +31,2 @@

expect(qs.parse('foo%3Dbar=baz'))
.to.eql({ foo: 'bar=baz' });
expect(qs.parse(' foo = bar = baz '))

@@ -56,2 +53,7 @@ .to.eql({ ' foo ': ' bar = baz ' });

it('should support encoded = signs', function(){
expect(qs.parse('he%3Dllo=th%3Dere'))
.to.eql({ 'he=llo': 'th=ere' });
})
it('should support nesting', function(){

@@ -58,0 +60,0 @@ expect(qs.parse('ops[>=]=25'))

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