sheetjs/bits/84_defaults.js
SheetJS 6bc24374b9 version bump 0.7.7: needs more cowbell
- parsexmltag and other hot functions now better optimized for v8
- monomorphic functions (different types -> different funcs)
- more efficient decode_range implementation when source is trusted
- regular expressions cached and simplified without breaking correctness
- more efficient utf8 techniques when available
- XLSX: large functions broken down into sub-functions (e.g. `parse_ws_xml`)
- XLSB: avoid unnecessary binds
- XLSB: assume no exotic codepage exists (no one else tries to write XLSB)
- demo exposes rABS / worker / transferable options
- more tests
- jszip updated to 2.3.0
- SSF updated to 0.8.1
- codepage updated to 1.3.1
2014-06-29 14:29:45 -04:00

37 lines
1.2 KiB
JavaScript

function fix_opts_func(defaults) {
return function fix_opts(opts) {
for(var i = 0; i != defaults.length; ++i) {
var d = defaults[i];
if(typeof opts[d[0]] === 'undefined') opts[d[0]] = d[1];
if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
}
};
}
var fix_read_opts = fix_opts_func([
['cellNF', false], /* emit cell number format string as .z */
['cellHTML', true], /* emit html string as .h */
['cellFormula', true], /* emit formulae as .f */
['cellStyles', false], /* emits style/theme as .s */
['sheetStubs', false], /* emit empty cells */
['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */
['bookDeps', false], /* parse calculation chains */
['bookSheets', false], /* only try to get sheet names (no Sheets) */
['bookProps', false], /* only try to get properties (no Sheets) */
['bookFiles', false], /* include raw file structure (keys, files) */
['bookVBA', false], /* include vba raw data (vbaraw) */
['WTF', false] /* WTF mode (throws errors) */
]);
var fix_write_opts = fix_opts_func([
['bookSST', false], /* Generate Shared String Table */
['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */
['WTF', false] /* WTF mode (throws errors) */
]);