New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stripe

Package Overview
Dependencies
Maintainers
4
Versions
671
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stripe - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

12

lib/utils.js

@@ -26,15 +26,9 @@ 'use strict';

/**
* Stringifies an Object, accommodating a single-level of nested objects
* Stringifies an Object, accommodating nested objects
* (forming the conventional key "parent[child]=value")
*/
stringifyRequestData: function(data, _key) {
stringifyRequestData: function(data) {
if (data.expand) {
data = _.cloneDeep(data);
data['expand[]'] = data.expand;
delete data.expand;
}
return qs.stringify(data, {arrayFormat: 'brackets'});
return qs.stringify(data, {indices: false});
},

@@ -41,0 +35,0 @@

{
"name": "stripe",
"version": "3.5.0",
"version": "3.5.1",
"description": "Stripe API wrapper",

@@ -35,3 +35,3 @@ "keywords": [

"bluebird": "^2.9.6",
"qs": "^2.3.3",
"qs": "^2.4.1",
"lodash": "^3.1.0"

@@ -38,0 +38,0 @@ },

@@ -40,3 +40,3 @@ 'use strict';

it('Handles deeply nested object', function() {
expect(utils.stringifyRequestData({
expect(decodeURI(utils.stringifyRequestData({
a: {

@@ -49,5 +49,14 @@ b: {

}
})).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=2');
}))).to.equal('a[b][c][d]=2');
});
it('Handles arrays of objects', function() {
expect(decodeURI(utils.stringifyRequestData({
a: [
{ b: 'c' },
{ b: 'd' },
]
}))).to.equal('a[][b]=c&a[][b]=d');
})
it('Creates a string from an object, handling shallow nested objects', function() {

@@ -74,5 +83,5 @@ expect(utils.stringifyRequestData({

it('Handles the `expand` array correctly (producing the form `expand[]=_` for each item', function() {
expect(utils.stringifyRequestData({
expect(decodeURI(utils.stringifyRequestData({
expand: ['a', 'foo', 'a.b.c']
})).to.equal('expand%5B%5D=a&expand%5B%5D=foo&expand%5B%5D=a.b.c');
}))).to.equal('expand[]=a&expand[]=foo&expand[]=a.b.c');
});

@@ -79,0 +88,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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