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

xlsx-template

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlsx-template - npm Package Compare versions

Comparing version 0.1.2-dev-20170926 to 0.1.2-dev-20171001

test/output/.npmignore

11

lib/index.js

@@ -185,3 +185,3 @@ /*jshint globalstrict:true, devel:true */

newCellsInserted = 0;
//console.log(substitutions, substitution, placeholder);
if(placeholder.full && placeholder.type === "table" && substitution instanceof Array) {

@@ -194,5 +194,10 @@ newCellsInserted = self.substituteTable(

// don't double-insert cells
if (newCellsInserted !== 0
|| substitution.length <= 1) {
appendCell = false;
}
// Did we insert new columns (array values)?
if(newCellsInserted !== 0) {
appendCell = false; // don't double-insert cells
cellsInserted += newCellsInserted;

@@ -714,3 +719,3 @@ self.pushRight(self.workbook, sheet.root, cell.attrib.r, newCellsInserted);

// add a cell for each element in the list
// add a cell for each element in the list
substitution.forEach(function(element) {

@@ -717,0 +722,0 @@ ++newCellsInserted;

{
"name": "xlsx-template",
"version": "0.1.2-dev-20170926",
"version": "0.1.2-dev-20171001",
"description": "Generate .xlsx (Excel) files from templates built in Excel",

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

@@ -171,3 +171,3 @@ /*jshint globalstrict:true, devel:true */

// XXX: For debugging only
fs.writeFileSync('test1.xlsx', newData, 'binary');
fs.writeFileSync('test/output/test1.xlsx', newData, 'binary');

@@ -283,3 +283,3 @@ done();

// XXX: For debugging only
fs.writeFileSync('test2.xlsx', newData, 'binary');
fs.writeFileSync('test/output/test2.xlsx', newData, 'binary');

@@ -334,3 +334,3 @@ done();

// XXX: For debugging only
fs.writeFileSync('test3.xlsx', newData, 'binary');
fs.writeFileSync('test/output/test3.xlsx', newData, 'binary');

@@ -474,3 +474,3 @@ done();

// XXX: For debugging only
fs.writeFileSync('test4.xlsx', newData, 'binary');
fs.writeFileSync('test/output/test4.xlsx', newData, 'binary');

@@ -540,3 +540,3 @@ done();

// XXX: For debugging only
fs.writeFileSync('test5.xlsx', newData, 'binary');
fs.writeFileSync('test/output/test5.xlsx', newData, 'binary');

@@ -594,3 +594,3 @@ done();

// fs.writeFileSync('test6.xlsx', newData, 'binary');
// fs.writeFileSync('test/output/test6.xlsx', newData, 'binary');
done();

@@ -616,3 +616,3 @@ });

// fs.writeFileSync('test7.xlsx', newData, 'binary');
// fs.writeFileSync('test/output/test7.xlsx', newData, 'binary');
done();

@@ -643,8 +643,32 @@ });

// fs.writeFileSync('test8.xlsx', newData, 'binary');
// fs.writeFileSync('test/output/test8.xlsx', newData, 'binary');
done();
});
});
it("Arrays with single element", function(done) {
fs.readFile(path.join(__dirname, 'templates', 'test-nested-arrays.xlsx'), function(err, data) {
buster.expect(err).toBeNull();
var t = new XlsxTemplate(data);
var data = { "sales": [ { "payments": [123], } ] };
t.substitute(1, data);
var newData = t.generate();
var sharedStrings = etree.parse(t.archive.file("xl/sharedStrings.xml").asText()).getroot(),
sheet1 = etree.parse(t.archive.file("xl/worksheets/sheet1.xml").asText()).getroot();
buster.expect(sheet1).toBeDefined();
var a1 = sheet1.find("./sheetData/row/c[@r='A1']/v");
var firstElement = sheet1.findall("./sheetData/row/c[@r='A1']");
buster.expect(a1).not.toBeNull();
buster.expect(a1.text).toEqual("123");
buster.expect(firstElement).not.toBeNull();
buster.expect(firstElement.length).toEqual(1);
fs.writeFileSync('test/output/test-nested-arrays.xlsx', newData, 'binary');
done();
});
});
});
});

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