mirror of
https://github.com/optilude/xlsx-template.git
synced 2026-07-02 00:17:39 +08:00
Fix linting errors
This commit is contained in:
@@ -149,6 +149,7 @@ You can pass options to `generate()` to set a different return type. use
|
||||
### Version 0.0.6
|
||||
|
||||
* You can now pass `options` to `generate()`, which are passed to JSZip
|
||||
* Fix setting of sheet <dimensions /> when growing the sheet
|
||||
* Fix corruption of sheet when writing dates
|
||||
* Fix corruption of sheet when calculating calcChain
|
||||
|
||||
|
||||
+5
-11
@@ -1,12 +1,11 @@
|
||||
/*jshint globalstrict:true, devel:true */
|
||||
/*global require, module, exports, process, __dirname, Buffer */
|
||||
/*eslint no-var:0 */
|
||||
/*global require, module, Buffer */
|
||||
"use strict";
|
||||
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
var path = require('path'),
|
||||
zip = require('node-zip'),
|
||||
etree = require('elementtree'),
|
||||
subElement = etree.SubElement;
|
||||
etree = require('elementtree');
|
||||
|
||||
module.exports = (function() {
|
||||
|
||||
@@ -330,8 +329,6 @@ module.exports = (function() {
|
||||
|
||||
// Get a list of sheet ids, names and filenames
|
||||
Workbook.prototype.loadSheets = function(prefix, workbook, workbookRels) {
|
||||
var self = this;
|
||||
|
||||
var sheets = [];
|
||||
|
||||
workbook.findall("sheets/sheet").forEach(function(sheet) {
|
||||
@@ -620,8 +617,6 @@ module.exports = (function() {
|
||||
|
||||
// Turn a value of any type into a string
|
||||
Workbook.prototype.stringify = function (value) {
|
||||
var self = this;
|
||||
|
||||
if(value instanceof Date) {
|
||||
//In Excel date is a number of days since 01/01/1900
|
||||
// timestamp in ms to days + number of days from 1900 to 1970
|
||||
@@ -985,8 +980,7 @@ module.exports = (function() {
|
||||
|
||||
}
|
||||
} else {
|
||||
var namedRef = self.splitRef(ref),
|
||||
namedCol = self.charToNum(namedRef.col);
|
||||
var namedRef = self.splitRef(ref);
|
||||
|
||||
if(namedRef.row > currentRow) {
|
||||
namedRef.row += numRows;
|
||||
|
||||
+8
-14
@@ -1,12 +1,12 @@
|
||||
/*jshint globalstrict:true, devel:true */
|
||||
/*global require, module, exports, process, __dirname, describe, before, after, it */
|
||||
/*eslint no-var:0 */
|
||||
/*global require, __dirname, describe, before, it */
|
||||
"use strict";
|
||||
|
||||
var buster = require('buster'),
|
||||
XlsxTemplate = require('../lib'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
zip = require('node-zip'),
|
||||
etree = require('elementtree');
|
||||
|
||||
buster.spec.expose();
|
||||
@@ -86,8 +86,7 @@ describe("CRUD operations", function() {
|
||||
]
|
||||
});
|
||||
|
||||
var newData = t.generate(),
|
||||
archive = new zip(newData, {base64: false, checkCRC32: true});
|
||||
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();
|
||||
@@ -195,8 +194,7 @@ describe("CRUD operations", function() {
|
||||
]
|
||||
});
|
||||
|
||||
var newData = t.generate(),
|
||||
archive = new zip(newData, {base64: false, checkCRC32: true});
|
||||
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();
|
||||
@@ -289,8 +287,7 @@ describe("CRUD operations", function() {
|
||||
singleCols: [10]
|
||||
});
|
||||
|
||||
var newData = t.generate(),
|
||||
archive = new zip(newData, {base64: false, checkCRC32: true});
|
||||
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();
|
||||
@@ -342,8 +339,7 @@ describe("CRUD operations", function() {
|
||||
]
|
||||
});
|
||||
|
||||
var newData = t.generate(),
|
||||
archive = new zip(newData, {base64: false, checkCRC32: true});
|
||||
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();
|
||||
@@ -481,11 +477,9 @@ describe("CRUD operations", function() {
|
||||
progress: 100
|
||||
});
|
||||
|
||||
var newData = t.generate(),
|
||||
archive = new zip(newData, {base64: false, checkCRC32: true});
|
||||
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(),
|
||||
var sheet1 = etree.parse(t.archive.file("xl/worksheets/sheet1.xml").asText()).getroot(),
|
||||
workbook = etree.parse(t.archive.file("xl/workbook.xml").asText()).getroot(),
|
||||
table1 = etree.parse(t.archive.file("xl/tables/table1.xml").asText()).getroot(),
|
||||
table2 = etree.parse(t.archive.file("xl/tables/table2.xml").asText()).getroot(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*jshint globalstrict:true, devel:true */
|
||||
/*global require, module, exports, process, __dirname, describe, before, after, it */
|
||||
/*eslint no-var:0 */
|
||||
/*global require, describe, before, it */
|
||||
"use strict";
|
||||
|
||||
var buster = require('buster'),
|
||||
|
||||
Reference in New Issue
Block a user