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

sparkpost

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparkpost - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

.env

3

CHANGELOG.md

@@ -7,2 +7,5 @@ # Change Log

## [1.3.6] - 2016-07-14
- [#148](https://github.com/SparkPost/node-sparkpost/pull/148) Preserve array/object structure of API data (@gpittarelli)
## [1.3.5] - 2016-05-13

@@ -9,0 +12,0 @@ - [#146](https://github.com/SparkPost/node-sparkpost/pull/146) Single recipient suppression list upserts now use the bulk update endpoint (@jgzamora)

17

lib/toApiFormat.js

@@ -15,3 +15,2 @@ 'use strict';

function snakedKeyClone(source) {
if (!_.isObject(source)) {

@@ -21,12 +20,4 @@ return source;

var target = {};
var target = Array.isArray(source) ? [] : {};
if (Array.isArray(source)) {
target = [];
for (var i = 0; i < source.length; i++) {
target.push(snakedKeyClone(source[i]));
}
return target;
}
Object.keys(source).forEach(function(key) {

@@ -56,4 +47,6 @@ target[_.snakeCase(key)] = snakedKeyClone(source[key]);

// Reinstated the un-modified objects into the target
pointer.walk(excludedObjects, function(val, ptr) {
pointer.set(target, ptr, val);
excludeList.forEach(function(exclusionPointer) {
if (pointer.has(excludedObjects, exclusionPointer)) {
pointer.set(target, exclusionPointer, pointer.get(excludedObjects, exclusionPointer));
}
});

@@ -60,0 +53,0 @@

{
"name": "sparkpost",
"version": "1.3.5",
"version": "1.3.6",
"description": "A Node.js wrapper for interfacing with your favorite SparkPost APIs",

@@ -5,0 +5,0 @@ "main": "./lib/sparkpost.js",

@@ -158,2 +158,28 @@ 'use strict';

});
it('should preserve objects with number properties', function(done) {
var testObj = {
array: [ 0, 1, , , , 5, 6]
, object: {
"0": 0,
"1": 1,
"5": 5,
"6": 6
}
, substitution_data: {
"0": 0,
"1": 1,
"5": 5,
"6": 6
}
, tags: [ 0, 1, , , , 5, 6]
};
var out = toApiFormat(_.clone(testObj));
expect(out).to.deep.equal(testObj);
done();
});
});
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