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

spread2json

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spread2json - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

48

lib/api.js

@@ -11,2 +11,3 @@ /**

var _ = require('lodash');
var async = require('async');
var googleapis = require('googleapis');

@@ -69,2 +70,4 @@ var xml2json = require('xml2json');

var BATCH_LIMIT = 40000;
/**

@@ -405,3 +408,3 @@ * xml escape

var entryXML = _.map(entry, function(v) {
var entryXmlList = _.map(entry, function(v) {
return BATCH_TEMPLATE.ENTRY({

@@ -414,13 +417,34 @@ key: key,

});
}).join('');
var opts = {
uri: URLS.BATCH(key, worksheetId),
method: 'POST',
headers: {
'Content-Type': 'application/atom+xml',
'If-Match': '*'
},
body: BATCH_TEMPLATE.BODY({ key: key, worksheetId: worksheetId, entry: entryXML })
};
return this.request(opts, callback);
});
if (entryXmlList.length < BATCH_LIMIT) {
var opts = {
uri: URLS.BATCH(key, worksheetId),
method: 'POST',
headers: {
'Content-Type': 'application/atom+xml',
'If-Match': '*'
},
body: BATCH_TEMPLATE.BODY({ key: key, worksheetId: worksheetId, entry: entryXmlList.join('') })
};
return this.request(opts, callback);
}
var self = this;
var unit = Math.ceil(entryXmlList.length / BATCH_LIMIT);
var splitEntryXmlList = _.times(unit, function() {
return entryXmlList.splice(0, BATCH_LIMIT);
});
async.eachSeries(splitEntryXmlList, function(list, next) {
var opts = {
uri: URLS.BATCH(key, worksheetId),
method: 'POST',
headers: {
'Content-Type': 'application/atom+xml',
'If-Match': '*'
},
body: BATCH_TEMPLATE.BODY({ key: key, worksheetId: worksheetId, entry: list.join('') })
};
self.request(opts, next);
}, callback);
};
{
"name": "spread2json",
"version": "0.3.2",
"version": "0.3.3",
"description": "spreadsheet convert json",

@@ -5,0 +5,0 @@ "main": "index.js",

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