Merge branch 'master' into master

This commit is contained in:
Andrey Kurdyumov
2017-09-13 21:11:26 +06:00
committed by GitHub
5 changed files with 36 additions and 17 deletions
+5 -6
View File
@@ -1,6 +1,5 @@
language: node_js
node_js:
- 0.12
- 4
- 6
language: node_js
node_js:
- 0.12
- 6
- 8
+8 -10
View File
@@ -4,7 +4,7 @@
"use strict";
var path = require('path'),
zip = require('node-zip'),
zip = require('jszip'),
etree = require('elementtree');
module.exports = (function() {
@@ -540,15 +540,13 @@ module.exports = (function() {
// optionally, `table`, `rowAbsolute` and `colAbsolute`.
Workbook.prototype.splitRef = function(ref) {
var match = ref.match(/(?:(.+)!)?(\$)?([A-Z]+)(\$)?([0-9]+)/);
if(match){
return {
table: match[1] || null,
colAbsolute: Boolean(match[2]),
col: match[3],
rowAbsolute: Boolean(match[4]),
row: parseInt(match[5], 10)
};
}
return {
table: match && match[1] || null,
colAbsolute: Boolean(match && match[2]),
col: match && match[3],
rowAbsolute: Boolean(match && match[4]),
row: parseInt(match && match[5], 10)
};
};
// Join an object with keys `row` and `col` into a single reference string
+1 -1
View File
@@ -31,7 +31,7 @@
],
"dependencies": {
"elementtree": "0.1.6",
"node-zip": "1.1.1"
"jszip": "^2.6.1"
},
"devDependencies": {
"buster": "0.7.18",
+22
View File
@@ -534,7 +534,29 @@ describe("CRUD operations", function() {
});
it("Correctly parse when formula in the file", function(done) {
fs.readFile(path.join(__dirname, 'templates', 'template.xlsx'), function(err, data) {
buster.expect(err).toBeNull();
var t = new XlsxTemplate(data);
t.substitute(1, {
people: [
{
name: "John Smith",
age: 55,
},
{
name: "John Doe",
age: 35,
}
]
});
done();
});
});
});
Binary file not shown.