enable programmatic enum for default properties for sheet_to_json #1536
perhaps i haven't found the right thing to try, but i would like to be able to use default values for some of the properties in sheet_to_json. e.g.
|Generate an array of arrays ("2D Array")
|Row object keys are literal column labels
|array of strings
|Use specified strings as keys in row objects
|Read and disambiguate first row as keys
I'd like to be able to pass the default -- read and disambiguate -- into the header property -- couldn't find a way to do so
The current implementation takes any other value as default, as represented in the test at https://github.com/SheetJS/js-xlsx/blob/master/bits/90_utils.js#L51-L53 . The safest thing to do is to set it to
null, and we'll make that the official case. If you'd like to submit a PR, the fix would be adding a line just after line 53, something like
else if(o.header == null) header = 0;
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?