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

can-param

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-param - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

16

can-param-test.js

@@ -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");
});

5

can-param.js

@@ -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.",

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