Comparing version 1.1.0 to 1.1.1
@@ -15,3 +15,3 @@ var QUnit = require("steal-qunit"); | ||
} | ||
}), encodeURI("age[or][][lte]=5&age[or][]=null")); | ||
}), encodeURI("age[or][0][lte]=5&age[or][1]=null")); | ||
@@ -26,1 +26,15 @@ QUnit.deepEqual(param({ | ||
}); | ||
QUnit.test("Encoding arrays of objects includes indices", function(){ | ||
var object = {items: [{name:'one'}, {name:'two'}]}; | ||
var out = param(object); | ||
QUnit.equal(out, "items%5B0%5D%5Bname%5D=one&items%5B1%5D%5Bname%5D=two"); | ||
}); | ||
QUnit.test("Encoding array of primitives does not include indices", function() { | ||
var object = {items: ['one', 'two']}; | ||
var out = param(object); | ||
QUnit.equal(out, "items%5B%5D=one&items%5B%5D=two"); | ||
}); |
@@ -7,3 +7,6 @@ "use strict"; | ||
for (var i = 0, l = obj.length; i < l; ++i) { | ||
buildParam(prefix + '[]', obj[i], add); | ||
var inner = obj[i]; | ||
var shouldIncludeIndex = typeof inner === 'object'; | ||
var arrayIndex = shouldIncludeIndex ? '[' + i + ']' : '[]'; | ||
buildParam(prefix + arrayIndex, inner, add); | ||
} | ||
@@ -10,0 +13,0 @@ } else if ( obj && typeof obj === "object" ) { |
@@ -1,2 +0,2 @@ | ||
/*can-param@1.0.4#can-param*/ | ||
/*can-param@1.1.0#can-param*/ | ||
define([ | ||
@@ -13,3 +13,6 @@ 'require', | ||
for (var i = 0, l = obj.length; i < l; ++i) { | ||
buildParam(prefix + '[]', obj[i], add); | ||
var inner = obj[i]; | ||
var shouldIncludeIndex = typeof inner === 'object'; | ||
var arrayIndex = shouldIncludeIndex ? '[' + i + ']' : '[]'; | ||
buildParam(prefix + arrayIndex, inner, add); | ||
} | ||
@@ -16,0 +19,0 @@ } else if (obj && typeof obj === 'object') { |
@@ -1,2 +0,2 @@ | ||
/*can-param@1.0.4#can-param*/ | ||
/*can-param@1.1.0#can-param*/ | ||
'use strict'; | ||
@@ -7,3 +7,6 @@ var namespace = require('can-namespace'); | ||
for (var i = 0, l = obj.length; i < l; ++i) { | ||
buildParam(prefix + '[]', obj[i], add); | ||
var inner = obj[i]; | ||
var shouldIncludeIndex = typeof inner === 'object'; | ||
var arrayIndex = shouldIncludeIndex ? '[' + i + ']' : '[]'; | ||
buildParam(prefix + arrayIndex, inner, add); | ||
} | ||
@@ -10,0 +13,0 @@ } else if (obj && typeof obj === 'object') { |
@@ -167,3 +167,3 @@ /*[process-shim]*/ | ||
/*can-param@1.0.4#can-param*/ | ||
/*can-param@1.1.0#can-param*/ | ||
define('can-param', [ | ||
@@ -180,3 +180,6 @@ 'require', | ||
for (var i = 0, l = obj.length; i < l; ++i) { | ||
buildParam(prefix + '[]', obj[i], add); | ||
var inner = obj[i]; | ||
var shouldIncludeIndex = typeof inner === 'object'; | ||
var arrayIndex = shouldIncludeIndex ? '[' + i + ']' : '[]'; | ||
buildParam(prefix + arrayIndex, inner, add); | ||
} | ||
@@ -183,0 +186,0 @@ } else if (obj && typeof obj === 'object') { |
{ | ||
"name": "can-param", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "can-param", | ||
@@ -5,0 +5,0 @@ "description": "Serialize an array or object into a query string.", |
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
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
19765
343
2