can-deparam
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -79,3 +79,10 @@ var deparam = require('./can-deparam'); | ||
QUnit.test(" handle '?' and '#' ", function(assert) { | ||
var result = deparam("?foo=bar&number=1234", stringToAny); | ||
assert.deepEqual(result, {"foo" : "bar", "number": 1234}); | ||
result = deparam("#foo[]=bar&foo[]=baz"); | ||
assert.deepEqual(result, {"foo" : ["bar", "baz"]}); | ||
}); | ||
/** / | ||
@@ -82,0 +89,0 @@ test("deparam an array", function(){ |
@@ -44,3 +44,7 @@ "use strict"; | ||
entityRegex = /%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i, | ||
startChars = {"#": true,"?": true}, | ||
prep = function (str) { | ||
if (startChars[str.charAt(0)] === true) { | ||
str = str.substr(1); | ||
} | ||
str = str.replace(/\+/g, ' '); | ||
@@ -47,0 +51,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*can-deparam@1.2.0#can-deparam*/ | ||
/*can-deparam@1.2.1#can-deparam*/ | ||
define('can-deparam', [ | ||
@@ -10,3 +10,9 @@ 'require', | ||
var namespace = require('can-namespace'); | ||
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) { | ||
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, startChars = { | ||
'#': true, | ||
'?': true | ||
}, prep = function (str) { | ||
if (startChars[str.charAt(0)] === true) { | ||
str = str.substr(1); | ||
} | ||
str = str.replace(/\+/g, ' '); | ||
@@ -13,0 +19,0 @@ try { |
@@ -1,2 +0,2 @@ | ||
/*can-deparam@1.2.0#can-deparam*/ | ||
/*can-deparam@1.2.1#can-deparam*/ | ||
define('can-deparam', [ | ||
@@ -10,3 +10,9 @@ 'require', | ||
var namespace = require('can-namespace'); | ||
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) { | ||
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, startChars = { | ||
'#': true, | ||
'?': true | ||
}, prep = function (str) { | ||
if (startChars[str.charAt(0)] === true) { | ||
str = str.substr(1); | ||
} | ||
str = str.replace(/\+/g, ' '); | ||
@@ -13,0 +19,0 @@ try { |
@@ -168,3 +168,3 @@ /*[process-shim]*/ | ||
/*can-deparam@1.2.0#can-deparam*/ | ||
/*can-deparam@1.2.1#can-deparam*/ | ||
define('can-deparam', [ | ||
@@ -178,3 +178,9 @@ 'require', | ||
var namespace = require('can-namespace'); | ||
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) { | ||
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, startChars = { | ||
'#': true, | ||
'?': true | ||
}, prep = function (str) { | ||
if (startChars[str.charAt(0)] === true) { | ||
str = str.substr(1); | ||
} | ||
str = str.replace(/\+/g, ' '); | ||
@@ -181,0 +187,0 @@ try { |
{ | ||
"name": "can-deparam", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Deserialize a query string into an array or object.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-deparam.html", |
Sorry, the diff of this file is not supported yet
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
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
27555
579
1