Skip to content

Commit

Permalink
Merge pull request #3 from bureson/master
Browse files Browse the repository at this point in the history
Complain about empty sheets
  • Loading branch information
larsthorup committed Jan 15, 2020
2 parents 01cd6c6 + 4a1a1a6 commit e011bc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sheet-reader",
"version": "1.0.16",
"version": "1.0.17",
"description": "Easily use a spreadsheet as an input format for your app",
"scripts": {
"lint": "semistandard --verbose",
Expand Down
1 change: 1 addition & 0 deletions sheet-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function parseWorkbook (workbook) {
return R.fromPairs(workbook.SheetNames.map(sheetKey => {
const workbookSheet = workbook.Sheets[sheetKey];
const workbookSheetRangeString = workbookSheet['!ref'];
if (!workbookSheetRangeString) throw new Error(`Sheet "${sheetKey}" appears to be empty`);
const workbookSheetRange = parseRange(workbookSheetRangeString);
const workSheet = XLSX.utils.sheet_to_json(workbookSheet);
const tolerance = 1000;
Expand Down

0 comments on commit e011bc8

Please sign in to comment.