Comparing version 0.9.0 to 0.10.0
@@ -39,4 +39,4 @@ 'use strict'; | ||
for (var R = 0; R !== data.length; ++R) { | ||
for (var C = 0; C !== data[R].length; ++C) { | ||
for (var R = 0; R !== data.length; R += 1) { | ||
for (var C = 0; C !== data[R].length; C += 1) { | ||
if (!Array.isArray(data[R])) throw new Error(R + 'th row data is not array'); | ||
@@ -43,0 +43,0 @@ |
@@ -27,3 +27,3 @@ 'use strict'; | ||
var sheet = workSheet.Sheets[name]; | ||
return { name: name, data: _xlsx2.default.utils.sheet_to_json(sheet, { header: 1, raw: true }) }; | ||
return { name: name, data: _xlsx2.default.utils.sheet_to_json(sheet, { header: 1, raw: options.raw !== false }) }; | ||
}); | ||
@@ -30,0 +30,0 @@ } |
{ | ||
"name": "node-xlsx", | ||
"author": "Olivier Louvignes <olivier@mg-crea.com>", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "NodeJS Excel files parser & builder", | ||
@@ -9,7 +9,7 @@ "main": "lib/index.js", | ||
"start": "npm run test:watch", | ||
"test": "mocha", | ||
"test": "NODE_ENV=test jest --runInBand", | ||
"test:watch": "npm run test -- --watch", | ||
"test:coverage": "nyc --reporter=lcov npm test -- --reporter dot && nyc report", | ||
"lint": "eslint src/", | ||
"compile": "rimraf lib/*; babel src/ -d lib/ -s", | ||
"test:coverage": "npm run test -- --coverage", | ||
"lint": "NODE_ENV=test eslint src/", | ||
"compile": "rimraf lib/*; NODE_ENV=production babel src/ -d lib/ -s", | ||
"compile:watch": "npm run compile -- -w", | ||
@@ -21,21 +21,20 @@ "prepublish": "npm run compile" | ||
"dependencies": { | ||
"xlsx": "^0.9.2" | ||
"xlsx": "^0.10.8" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.16.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-plugin-transform-class-properties": "^6.16.0", | ||
"babel-plugin-transform-function-bind": "^6.8.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.16.0", | ||
"babel-preset-es2015": "^6.16.0", | ||
"babel-register": "^6.16.3", | ||
"codeclimate-test-reporter": "^0.4.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-airbnb-base": "^9.0.0", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"babel-cli": "^6.24.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-function-bind": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-register": "^6.24.1", | ||
"codacy-coverage": "^2.0.2", | ||
"debug-utils": "^0.2.1", | ||
"eslint": "^4.3.0", | ||
"eslint-config-airbnb-base": "^11.2.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"expect": "^1.20.2", | ||
"mocha": "^3.1.2", | ||
"nyc": "^8.3.1", | ||
"rimraf": "^2.5.4" | ||
"jest": "^20.0.4", | ||
"rimraf": "^2.6.1" | ||
}, | ||
@@ -48,3 +47,6 @@ "keywords": [ | ||
"xls" | ||
] | ||
], | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
} |
@@ -20,4 +20,4 @@ import XLSX from 'xlsx'; | ||
for (let R = 0; R !== data.length; ++R) { | ||
for (let C = 0; C !== data[R].length; ++C) { | ||
for (let R = 0; R !== data.length; R += 1) { | ||
for (let C = 0; C !== data[R].length; C += 1) { | ||
if (!Array.isArray(data[R])) throw new Error(`${R}th row data is not array`); | ||
@@ -24,0 +24,0 @@ |
@@ -10,3 +10,3 @@ | ||
const sheet = workSheet.Sheets[name]; | ||
return {name, data: XLSX.utils.sheet_to_json(sheet, {header: 1, raw: true})}; | ||
return {name, data: XLSX.utils.sheet_to_json(sheet, {header: 1, raw: options.raw !== false})}; | ||
}); | ||
@@ -13,0 +13,0 @@ } |
@@ -21,2 +21,8 @@ import fs from 'fs'; | ||
}); | ||
it('should properly parse an XLSX file with date field', () => { | ||
const expected = JSON.parse(fs.readFileSync(`${__dirname}/../fixtures/dateField.json`)); | ||
const file = `${__dirname}/../fixtures/dateField.xlsx`; | ||
const result = JSON.parse(JSON.stringify(parseXSLX(file, {raw: false}))); | ||
expect(result).toEqual(expected); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48039
15
25
326
+ Addedadler-32@1.1.0(transitive)
+ Addedcfb@0.12.1(transitive)
+ Addedcodepage@1.10.2(transitive)
+ Addedcommander@2.11.0(transitive)
+ Addedcrc-32@1.1.1(transitive)
+ Addedfrac@1.1.2(transitive)
+ Addedprintj@1.1.2(transitive)
+ Addedssf@0.10.3(transitive)
+ Addedvoc@1.0.0(transitive)
+ Addedxlsx@0.10.9(transitive)
- Removedadler-32@1.0.0(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedcfb@0.11.1(transitive)
- Removedcodepage@1.8.1(transitive)
- Removedcolors@0.6.2(transitive)
- Removedcommander@2.9.0(transitive)
- Removedconcat-stream@2.0.0(transitive)
- Removedcrc-32@1.0.2(transitive)
- Removedfrac@1.0.6(transitive)
- Removedgraceful-readlink@1.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedprintj@1.3.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedssf@0.9.4(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvoc@1.2.0(transitive)
- Removedxlsx@0.9.13(transitive)
Updatedxlsx@^0.10.8