forked from sheetjs/sheetjs
SheetJS
6bc24374b9
- 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
25 lines
746 B
JavaScript
25 lines
746 B
JavaScript
/* [MS-XLSB] 2.4.219 BrtBeginSst */
|
|
function parse_BrtBeginSst(data, length) {
|
|
return [data.read_shift(4), data.read_shift(4)];
|
|
}
|
|
|
|
/* [MS-XLSB] 2.1.7.45 Shared Strings */
|
|
function parse_sst_bin(data, opts) {
|
|
var s = [];
|
|
var pass = false;
|
|
recordhopper(data, function hopper_sst(val, R, RT) {
|
|
switch(R.n) {
|
|
case 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;
|
|
case 'BrtSSTItem': s.push(val); break;
|
|
case 'BrtEndSst': return true;
|
|
/* TODO: produce a test case with a future record */
|
|
case 'BrtFRTBegin': pass = true; break;
|
|
case 'BrtFRTEnd': pass = false; break;
|
|
default: if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R.n);
|
|
}
|
|
});
|
|
return s;
|
|
}
|
|
|
|
function write_sst_bin(sst, opts) { }
|