stephen-hardy / xlsx.js

XLSX.js is a JavaScript library for converting the data in base64 XLSX files into JavaScript objects - and back! Please note that this library is licensed under the Microsoft Office Extensible File License - a license NOT approved by the OSI. While this license is based off of the MS-PL, which is OSI-approved, there are significant differences.
http://blog.innovatejs.com/?tag=xlsx-js
Other
575 stars 122 forks source link

Allow integer input and other "string convertibles" #16

Closed radicand closed 10 years ago

stephen-hardy commented 10 years ago

Hello Radicand,

I've incorporated the thought behind your first "Don't assume input is a string" commit, by checking the input type using typeof. Duck typing, by checking for the replace method, could have some concerns as the library grows.

I'll look into the additions in your second "Don't assume input is a string" commit when I get time, but could you clarify the "fix xls bug" commit? Do you have repro steps?

Unfortunately, I cannot merge the pull request as a whole due to the changes that have happened since the original submission. I'll try to incorporate all the thoughts, but I'll need to close the pull request.

Thanks, Stephen

aburai commented 10 years ago

i have also an issue with the usage of cell.hasOwnProperty(), but i have no notice how to reproduce

i changed it to

val = (cell && 'value' in cell ? cell.value : cell);

radicand commented 10 years ago

Thanks for looking at this -- it has been awhile since I've needed to look at this, but the other commits are aimed at solving exception issues I had when feeding certain outputs in. What I will need to do for you is concoct a real test-case with sample inputs that cause the errors. This may take some time.