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

can-deparam

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-deparam - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

can-deparam-test.js

@@ -39,2 +39,8 @@ var deparam = require('./can-deparam');

});
test('Invalid encoding', function() {
var data = deparam('foo=%0g');
deepEqual(data, {
foo: '%0g'
});
});
/** /

@@ -41,0 +47,0 @@ test("deparam an array", function(){

12

can-deparam.js

@@ -24,4 +24,14 @@ var namespace = require("can-namespace");

paramTest = /([^?#]*)(#.*)?$/,
entityRegex = /%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i,
prep = function (str) {
return decodeURIComponent(str.replace(/\+/g, ' '));
str = str.replace(/\+/g, ' ');
try {
return decodeURIComponent(str);
}
catch (e) {
return decodeURIComponent(str.replace(entityRegex, function(match, hex) {
return '%25' + hex;
}));
}
};

@@ -28,0 +38,0 @@ module.exports = namespace.deparam = function (params) {

13

dist/amd/can-deparam.js

@@ -1,6 +0,13 @@

/*can-deparam@0.0.0#can-deparam*/
/*can-deparam@1.0.0#can-deparam*/
define(function (require, exports, module) {
var namespace = require('can-namespace');
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, prep = function (str) {
return decodeURIComponent(str.replace(/\+/g, ' '));
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, entityRegex = /%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i, prep = function (str) {
str = str.replace(/\+/g, ' ');
try {
return decodeURIComponent(str);
} catch (e) {
return decodeURIComponent(str.replace(entityRegex, function (match, hex) {
return '%25' + hex;
}));
}
};

@@ -7,0 +14,0 @@ module.exports = namespace.deparam = function (params) {

@@ -1,5 +0,12 @@

/*can-deparam@0.0.0#can-deparam*/
/*can-deparam@1.0.0#can-deparam*/
var namespace = require('can-namespace');
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, prep = function (str) {
return decodeURIComponent(str.replace(/\+/g, ' '));
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, entityRegex = /%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i, prep = function (str) {
str = str.replace(/\+/g, ' ');
try {
return decodeURIComponent(str);
} catch (e) {
return decodeURIComponent(str.replace(entityRegex, function (match, hex) {
return '%25' + hex;
}));
}
};

@@ -6,0 +13,0 @@ module.exports = namespace.deparam = function (params) {

@@ -110,7 +110,14 @@ /*[global-shim-start]*/

)
/*can-deparam@0.0.0#can-deparam*/
/*can-deparam@1.0.0#can-deparam*/
define('can-deparam', function (require, exports, module) {
var namespace = require('can-namespace');
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, prep = function (str) {
return decodeURIComponent(str.replace(/\+/g, ' '));
var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, paramTest = /([^?#]*)(#.*)?$/, entityRegex = /%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i, prep = function (str) {
str = str.replace(/\+/g, ' ');
try {
return decodeURIComponent(str);
} catch (e) {
return decodeURIComponent(str.replace(entityRegex, function (match, hex) {
return '%25' + hex;
}));
}
};

@@ -117,0 +124,0 @@ module.exports = namespace.deparam = function (params) {

{
"name": "can-deparam",
"version": "1.0.0",
"version": "1.0.1",
"description": "Deserialize a query string into an array or object.",

@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/",

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