Skip to content

Commit

Permalink
* fix xlsx dependency for now before we fix #694
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed Dec 12, 2019
1 parent 4eb3c44 commit acbf6ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"cors": "*",
"csv-parse": "^0.0.6",
"iconv-lite": "^0.4.13",
"xlsx": "^0.14.5",
"j": "^1.0.0",
"livescript": "1.5.x",
"minimatch": "*",
Expand Down

3 comments on commit acbf6ab

@ocdtrekkie
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@audreyt Was it intentional to make this change on the Sandstorm branch?

@audreyt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No :) Thank you for the reminder, I've cherry-picked it to master.

@eddyparkinson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SheetJS people said:

Single-sheet conversion to ETH can be performed with:

XLSX.write(wb, {
  type:"binary", /* you can change this to "array" or "buffer" depending on where you are running the code */
  bookType: "eth",
  sheet: "name_of_worksheet"
});

The direct equivalent of the old utility function would be:

function sheet_to_eth(ws) {
  // stub workbook
  const wb = XLSX.utils.book_new();
  XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
  // call XLSX.write
  return XLSX.write(wb, {type: "binary", bookType: "eth", sheet: "Sheet1"});
}

Please sign in to comment.