Lines Matching refs:opts

461 function SSF_parse_date_code(v/*:number*/,opts/*:?any*/,b2/*:?boolean*/) {  argument
467 if(opts && opts.date1904) date += 1462;
549 function SSF_general(v/*:any*/, opts/*:any*/) { argument
557 if(v instanceof Date) return SSF_format(14, datenum_local(v, opts && opts.date1904), opts);
986 function eval_fmt(fmt/*:string*/, v/*:any*/, opts/*:any*/, flen/*:number*/) { argument
1005 … if(dt==null) { dt=SSF_parse_date_code(v, opts, fmt.charAt(i+1) === "2"); if(dt==null) return ""; }
1014 if(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return ""; }
1021 if(dt==null) dt=SSF_parse_date_code(v, opts);
1033 if(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return ""; }
1125 case 'G': out[i].t = 't'; out[i].v = SSF_general(v,opts); break;
1929 function init_cfb(cfb/*:CFBContainer*/, opts/*:?any*/)/*:void*/ {
1930 var o = opts || {}, root = o.root || "Root Entry";
3107 var opts = options || {};
3108 var boundary = opts.boundary || "SheetJS";
3143 out.push('Content-Location: ' + (opts.root || 'file:///C:/SheetJS/') + fp);
3153 function cfb_new(opts/*:?any*/)/*:CFBContainer*/ {
3155 init_cfb(o, opts);
3159 function cfb_add(cfb/*:CFBContainer*/, name/*:string*/, content/*:?RawBytes*/, opts/*:?any*/)/*:CFB…
3160 var unsafe = opts && opts.unsafe;
3178 if(opts) {
3179 if(opts.CLSID) file.clsid = opts.CLSID;
3180 if(opts.mt) file.mt = opts.mt;
3181 if(opts.ct) file.ct = opts.ct;
3814 function parseVector(data/*:string*/, opts)/*:Array<{v:string,t:string}>*/ { argument
3820 if(opts.WTF) throw new Error("unexpected vector length " + matches.length + " != " + h.size);
4143 function parsenoop(blob, length/*:: :number, opts?:any */) { blob.l += length; }
4152 function recordhopper(data, cb/*:RecordHopperCB*/, opts/*:?any*/) { argument
4165 var d = R.f && R.f(data, length, opts);
4227 function shift_cell_xls(cell/*:CellAddress*/, tgt/*:any*/, opts/*:?any*/)/*:CellAddress*/ { argument
4236 if(!opts || opts.biff < 12) {
4243 function shift_range_xls(cell, range, opts) { argument
4245 out.s = shift_cell_xls(out.s, range.s, opts);
4246 out.e = shift_cell_xls(out.e, range.s, opts);
4259 function encode_range_xls(r, opts)/*:string*/ { argument
4261 if(r.e.r == (opts.biff >= 12 ? 0xFFFFF : (opts.biff >= 8 ? 0x10000 : 0x4000)) && !r.e.rRel) {
4266 if(r.e.c == (opts.biff >= 12 ? 0x3FFF : 0xFF) && !r.e.cRel) {
4270 return encode_cell_xls(r.s, opts.biff) + ":" + encode_cell_xls(r.e, opts.biff);
4324 function formula_quote_sheet_name(sname/*:string*/, opts)/*:string*/ { argument
4325 if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
4378 function sheet_to_workbook(sheet/*:Worksheet*/, opts)/*:Workbook*/ { argument
4379 var n = opts && opts.sheet ? opts.sheet : "Sheet1";
4384 function sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ { argument
4385 var o = opts || {};
4450 function aoa_to_sheet(data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ { return sheet_add_aoa(null, data,… argument
4718 function parse_FontFlags(data/*::, length, opts*/) {
5339 function write_ct(ct, opts, raw)/*:string*/ { argument
5377 'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx']
5387 'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx']
5514 function parse_manifest(d, opts) { argument
5529 default: if(opts && opts.WTF) throw Rn;
5569 function write_meta_ods(/*:: wb: Workbook, opts: any*/)/*:string*/ {
5624 var opts = _opts || {};
5633 if(!cp && !opts.Props) return o.join("");
5636 ….CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"…
5637 …difiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"…
5642 var v = opts.Props && opts.Props[f[1]] != null ? opts.Props[f[1]] : cp ? cp[f[1]] : null;
5672 function load_props_pairs(HP/*:string|Array<Array<any>>*/, TOP, props, opts) { argument
5674 if(typeof HP == "string") v = parseVector(HP, opts);
5676 …var parts = (typeof TOP == "string") ? parseVector(TOP, opts).map(function (x) { return x.v; }) : …
5719 function parse_ext_props(data, p, opts) { argument
5735 if(q.HeadingPairs && q.TitlesOfParts) load_props_pairs(q.HeadingPairs, q.TitlesOfParts, p, opts);
5740 function write_ext_props(cp/*::, opts*/)/*:string*/ {
5768 function parse_cust_props(data/*:string*/, opts) { argument
5803 if(opts.WTF && typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);
5806 } else if(opts.WTF) throw new Error(x);
5812 function write_cust_props(cp/*::, opts*/)/*:string*/ {
5870 function xlml_write_docprops(Props, opts) { argument
5878 var m = opts && opts.Props && opts.Props[p[1]] != null ? opts.Props[p[1]] : Props[p[1]];
5889 function xlml_write_custprops(Props, Custprops/*::, opts*/) {
6037 var t = blob.read_shift(2), ret, opts = _opts||{};
6042 case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
6051 case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw).replace(chr0,'');
6320 function parseuint16(blob/*::, length:?number, opts:?any*/) { return blob.read_shift(2, 'u'); }
6322 function parseuint16a(blob, length/*:: :?number, opts:?any*/) { return parslurp(blob,length,parseui…
6339 function parse_ShortXLUnicodeString(blob, length, opts) { argument
6340 var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1);
6343 if(opts && opts.biff >= 8) current_codepage = 1200;
6344 if(!opts || opts.biff == 8 ) {
6347 } else if(opts.biff == 12) {
6350 if(opts.biff >= 2 && opts.biff <= 5) encoding = 'cpstr';
6376 function write_XLUnicodeRichExtendedString(xlstr/*:: :XLString, opts*/) {
6393 function parse_XLUnicodeStringNoCch(blob, cch, opts) { argument
6395 if(opts) {
6396 if(opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, 'cpstr');
6397 if(opts.biff >= 12) return blob.read_shift(cch, 'dbcs-cont');
6406 function parse_XLUnicodeString(blob, length, opts) { argument
6407 var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
6409 return parse_XLUnicodeStringNoCch(blob, cch, opts);
6412 function parse_XLUnicodeString2(blob, length, opts) { argument
6413 if(opts.biff > 5) return parse_XLUnicodeString(blob, length, opts);
6416 return blob.read_shift(cch, (opts.biff <= 4 || !blob.lens ) ? 'cpstr' : 'sbcs-cont');
6419 function write_XLUnicodeString(str, opts, o) { argument
6428 function parse_ControlInfo(blob/*::, length, opts*/) {
6437 function parse_URLMoniker(blob/*::, length, opts*/) {
6584 …arse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? "" : parse_XLUnicodeString2(bl… argument
6587 function parse_XTI(blob, length, opts) { argument
6588 var w = opts.biff > 8 ? 4 : 2;
6601 function parse_AddinUdf(blob, length, opts) { argument
6604 var udfName = parse_ShortXLUnicodeString(blob, length, opts);
6762 function parse_WriteAccess(blob, length, opts) { argument
6763 if(opts.enc) { blob.l += length; return ""; }
6766 var UserName = parse_XLUnicodeString2(blob, 0, opts);
6770 function write_WriteAccess(s/*:string*/, opts) { argument
6771 var b8 = !opts || opts.biff == 8;
6773 o.write_shift(opts.biff == 8 ? 2 : 1, 7);
6782 function parse_WsBool(blob, length, opts) { argument
6783 var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0);
6788 function parse_BoundSheet8(blob, length, opts) { argument
6798 var name = parse_ShortXLUnicodeString(blob, 0, opts);
6802 function write_BoundSheet8(data, opts) { argument
6803 var w = (!opts || opts.biff >= 8 ? 2 : 1);
6809 if(opts.biff >= 8) o.write_shift(1, 1);
6810 o.write_shift(w * data.name.length, data.name, opts.biff < 8 ? 'sbcs' : 'utf16le');
6827 function write_SST(sst, opts) { argument
6832 for(var j = 0; j < sst.length; ++j) strs[j] = write_XLUnicodeRichExtendedString(sst[j], opts);
6884 function parse_DefaultRowHeight(blob, length, opts) { argument
6886 if(!(opts && opts.biff == 2)) {
6890 if((opts && opts.biff == 2)) {
6905 function write_Window1(/*::opts*/) {
6919 function parse_Window2(blob, length, opts) { argument
6920 if(opts && opts.biff >= 2 && opts.biff < 5) return {};
6936 function parse_Pane(/*blob, length, opts*/) {
6940 function parse_Font(blob, length, opts) { argument
6945 switch((opts && opts.biff) || 8) {
6950 o.name = parse_ShortXLUnicodeString(blob, 0, opts);
6953 function write_Font(data, opts) { argument
6955 var b5 = (opts && (opts.biff == 5)), w = (b5 ? (15 + name.length) : (16 + 2 * name.length));
6974 function write_LabelSst(R/*:number*/, C/*:number*/, v/*:number*/, os/*:number*/ /*::, opts*/) {
6982 function parse_Label(blob, length, opts) { argument
6983 if(opts.biffguess && opts.biff == 2) opts.biff = 5;
6986 if(opts.biff == 2) blob.l++;
6987 var str = parse_XLUnicodeString(blob, target - blob.l, opts);
6991 function write_Label(R/*:number*/, C/*:number*/, v/*:string*/, os/*:number*/, opts) { argument
6992 var b8 = !opts || opts.biff == 8;
7003 function parse_Format(blob, length, opts) { argument
7005 var fmtstr = parse_XLUnicodeString2(blob, 0, opts);
7008 function write_Format(i/*:number*/, f/*:string*/, opts, o) { argument
7009 var b5 = (opts && (opts.biff == 5));
7022 function parse_Dimensions(blob, length, opts) { argument
7024 var w = opts.biff == 8 || !opts.biff ? 4 : 2;
7030 function write_Dimensions(range, opts) { argument
7031 var w = opts.biff == 8 || !opts.biff ? 4 : 2;
7072 function parse_CellStyleXF(blob, length, style, opts) { argument
7078 if(!opts.cellStyles) return o;
7112 //function parse_CellXF(blob, length, opts) {return parse_CellStyleXF(blob,length,0, opts);}
7113 //function parse_StyleXF(blob, length, opts) {return parse_CellStyleXF(blob,length,1, opts);}
7116 function parse_XF(blob, length, opts) { argument
7121 o.data = parse_CellStyleXF(blob, length, o.fStyle, opts);
7124 function write_XF(data, ixfeP, opts, o) { argument
7125 var b5 = (opts && (opts.biff == 5));
7162 function parse_BoolErr(blob, length, opts) { argument
7164 if(opts.biff == 2 || length == 9) ++blob.l;
7170 function write_BoolErr(R/*:number*/, C/*:number*/, v, os/*:number*/, opts, t/*:string*/) { argument
7178 function parse_Number(blob, length, opts) { argument
7179 if(opts.biffguess && opts.biff == 2) opts.biff = 5;
7185 function write_Number(R/*:number*/, C/*:number*/, v, os/*:: :number, opts*/) {
7195 function parse_SupBook(blob, length, opts) { argument
7199 opts.sbcch = cch;
7210 function parse_ExternName(blob, length, opts) { argument
7222 if(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2, opts);
7223 //else throw new Error("unsupported SupBook cch: " + opts.sbcch);
7230 function parse_Lbl(blob, length, opts) { argument
7235 var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
7237 if(!opts || opts.biff >= 5) {
7238 if(opts.biff != 5) blob.l += 2;
7240 if(opts.biff == 5) blob.l += 2;
7243 var name = parse_XLUnicodeStringNoCch(blob, cch, opts);
7245 var npflen = target - blob.l; if(opts && opts.biff == 2) --npflen;
7247 …t == blob.l || cce === 0 || !(npflen > 0)) ? [] : parse_NameParsedFormula(blob, npflen, opts, cce);
7258 function parse_ExternSheet(blob, length, opts) { argument
7259 if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
7260 var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
7261 while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
7266 function parse_BIFF5ExternSheet(blob, length, opts) { argument
7268 var o = parse_ShortXLUnicodeString(blob, length, opts);
7273 function parse_NameCmt(blob, length, opts) { argument
7274 if(opts.biff < 8) { blob.l += length; return; }
7277 var name = parse_XLUnicodeStringNoCch(blob, cchName, opts);
7278 var comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts);
7283 function parse_ShrFmla(blob, length, opts) { argument
7288 return [parse_SharedParsedFormula(blob, length, opts), cUse, ref];
7292 function parse_Array(blob, length, opts) { argument
7295 switch(opts.biff) {
7300 return [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];
7312 function parse_NoteSh(blob, length, opts) { argument
7313 if(opts.biff < 8) return;
7316 var stAuthor = parse_XLUnicodeString2(blob, 0, opts);
7317 if(opts.biff < 8) blob.read_shift(1);
7322 function parse_Note(blob, length, opts) { argument
7324 return parse_NoteSh(blob, length, opts);
7342 function parse_Obj(blob, length, opts) { argument
7343 if(opts && opts.biff < 8) return parse_BIFF5Obj(blob, length, opts);
7366 function parse_BIFF5Obj(blob, length, opts) { argument
7383 fts.push((parse_BIFF5OT[ot]||parsenoop)(blob, length, opts));
7388 function parse_TxO(blob, length, opts) { argument
7393 var ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];
7396 else controlInfo = parse_ControlInfo(blob, 6, opts); // eslint-disable-line no-unused-vars
7506 function parse_ColInfo(blob, length, opts) { argument
7507 if(!opts.cellStyles) return parsenoop(blob, length);
7508 var w = opts && opts.biff >= 12 ? 4 : 2;
7516 if(opts.biff >= 5 || !opts.biff) o.level = (flags >> 8) & 0x7;
7546 function parse_ShtProps(blob, length, opts) { argument
7548 if(opts.biff != 5) { blob.l += length; return def; }
7576 function parse_BIFF2STR(blob, length, opts) { argument
7577 if(opts.biffguess && opts.biff == 5) opts.biff = 2;
7580 var str = parse_XLUnicodeString2(blob, length-7, opts);
7633 function parse_RString(blob, length, opts) { argument
7637 var str = parse_XLUnicodeStringNoCch(blob, cch, opts);
7703 function dbf_to_aoa(buf, opts)/*:AOA*/ { argument
7706 switch(opts.type) {
7743 var /*flags = 0,*/ current_cp = opts.codepage || 1252;
7774 … if((!vfp || field.len != 8) && opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
7778 if(opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
7861 if(opts && opts.sheetRows) out = out.slice(0, opts.sheetRows);
7862 opts.DBF = fields;
7866 function dbf_to_sheet(buf, opts)/*:Worksheet*/ {
7867 var o = opts || {};
7878 function dbf_to_workbook(buf, opts)/*:Workbook*/ {
7880 var o = sheet_to_workbook(dbf_to_sheet(buf, opts), opts);
7883 } catch(e) { if(opts && opts.WTF) throw e; }
7888 function sheet_to_dbf(ws/*:Worksheet*/, opts/*:WriteOpts*/) {
7889 var o = opts || {};
8050 function sylk_to_aoa(d/*:RawData*/, opts)/*:[AOA, Worksheet]*/ { argument
8051 switch(opts.type) {
8052 case 'base64': return sylk_to_aoa_str(Base64_decode(d), opts);
8053 case 'binary': return sylk_to_aoa_str(d, opts);
8054 …ffer': return sylk_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts);
8055 case 'array': return sylk_to_aoa_str(cc2str(d), opts);
8057 throw new Error("Unrecognized type " + opts.type);
8059 function sylk_to_aoa_str(str/*:string*/, opts)/*:[AOA, Worksheet]*/ { argument
8066 if(+opts.codepage >= 0) set_cp(+opts.codepage);
8093 … case 'E': nn.Ref = (opts && opts.sheet || "Sheet1") + "!" + rc_to_a1(record[rj].slice(1)); break;
8114 …if(next_cell_format !== null && fmt_is_date(next_cell_format) && opts.cellDates) { val = numdate(w…
8117 if(!opts.cellDates) { cell_t = "n"; val = datenum(val, wb.Workbook.WBProps.date1904); }
8119 …d' && typeof val == "string" && ((opts||{}).type != "string") && (opts||{}).codepage) val = $cptab…
8134 default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
8140 …if(opts.cellText !== false && next_cell_format) arr[R][C].w = SSF_format(arr[R][C].z, arr[R][C].v,…
8189 default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
8192 default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
8198 if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
8202 function sylk_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ {
8203 var aoasht = sylk_to_aoa(d, opts);
8205 var _opts = dup(opts); _opts.date1904 = (((wb||{}).Workbook || {}).WBProps || {}).date1904;
8208 var outwb = sheet_to_workbook(o, opts);
8214 …function write_ws_cell_sylk(cell/*:Cell*/, ws/*:Worksheet*/, R/*:number*/, C/*:number*//*::, opts*…
8251 function sheet_to_sylk(ws/*:Worksheet*/, opts/*:?any*/, wb/*:?WorkBook*/)/*:string*/ {
8272 p.push(write_ws_cell_sylk(cell, ws, R, C, opts)); // TODO: pass date1904 info
8286 function dif_to_aoa(d/*:RawData*/, opts)/*:AOA*/ { argument
8287 switch(opts.type) {
8288 case 'base64': return dif_to_aoa_str(Base64_decode(d), opts);
8289 case 'binary': return dif_to_aoa_str(d, opts);
8290 …uffer': return dif_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts);
8291 case 'array': return dif_to_aoa_str(cc2str(d), opts);
8293 throw new Error("Unrecognized type " + opts.type);
8295 function dif_to_aoa_str(str/*:string*/, opts)/*:AOA*/ { argument
8327 if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
8331 …function dif_to_sheet(str/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(dif_to_aoa(str, op… argument
8332 function dif_to_workbook(str/*:string*/, opts)/*:Workbook*/ { argument
8333 var o = sheet_to_workbook(dif_to_sheet(str, opts), opts);
8340 function sheet_to_dif(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {
8397 function eth_to_aoa(str/*:string*/, opts)/*:AOA*/ { argument
8418 if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
8422 …function eth_to_sheet(d/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(eth_to_aoa(d, opts),… argument
8423 …function eth_to_workbook(d/*:string*/, opts)/*:Workbook*/ { return sheet_to_workbook(eth_to_sheet(… argument
8481 function sheet_to_eth(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {
8504 function prn_to_aoa_str(f/*:string*/, opts)/*:AOA*/ { argument
8505 var o = opts || {};
8570 function dsv_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { argument
8571 var o = opts || {};
8642 function prn_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ {
8643 if(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts);
8644 if(opts.FS) return dsv_to_sheet_str(str, opts);
8645 if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts);
8646 …f("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts);
8647 return aoa_to_sheet(prn_to_aoa_str(str, opts), opts);
8650 function prn_to_sheet(d/*:RawData*/, opts)/*:Worksheet*/ {
8651 var str = "", bytes = opts.type == 'string' ? [0,0,0,0] : firstbyte(d, opts);
8652 switch(opts.type) {
8656 if(opts.codepage == 65001) str = d.toString('utf8'); // TODO: test if buf
8657 …else if(opts.codepage && typeof $cptable !== 'undefined') str = $cptable.utils.decode(opts.codepag…
8662 default: throw new Error("Unrecognized type " + opts.type);
8665 …else if(opts.type != 'string' && opts.type != 'buffer' && opts.codepage == 65001) str = utf8read(s…
8666 …else if((opts.type == 'binary') && typeof $cptable !== 'undefined' && opts.codepage) str = $cptab…
8667 …0,19) == "socialcalc:version:") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), o…
8668 return prn_to_sheet_str(str, opts);
8671 …function prn_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ { return sheet_to_workbook(prn_to_sheet…
8673 function sheet_to_prn(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {
8700 function read_wb_ID(d, opts) { argument
8701 var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
8709 return PRN.to_workbook(d, opts);
8714 function lotushopper(data, cb/*:RecordHopperCB*/, opts/*:any*/) { argument
8717 var Enum = opts.Enum || WK1Enum;
8723 var d = R.f && R.f(data, length, opts);
8729 function lotus_to_workbook(d/*:RawData*/, opts) { argument
8730 switch(opts.type) {
8731 case 'base64': return lotus_to_workbook_buf(s2a(Base64_decode(d)), opts);
8732 case 'binary': return lotus_to_workbook_buf(s2a(d), opts);
8734 case 'array': return lotus_to_workbook_buf(d, opts);
8736 throw "Unsupported type " + opts.type;
8739 function lotus_to_workbook_buf(d, opts)/*:Workbook*/ { argument
8741 var o = opts || {};
8749 if(d[4] == 0x51 && d[5] == 0x50 && d[6] == 0x57) return qpw_to_workbook_buf(d, opts);
8866 function sheet_to_wk1(ws/*:Worksheet*/, opts/*:WriteOpts*/) {
8867 var o = opts || {};
8900 function book_to_wk3(wb/*:Workbook*/, opts/*:WriteOpts*/) {
8901 var o = opts || {};
8977 function parse_RANGE(blob, length, opts) {
8979 if(length == 8 && opts.qpro) {
8990 if(length == 12 && opts.qpro) blob.l += 2;
8993 if(length == 12 && opts.qpro) blob.l += 2;
9006 function parse_cell(blob, length, opts) {
9008 if(opts.qpro && opts.vers != 0x5120) {
9013 } else if(opts.works) { // TODO: verify with more complex works3-4 examples
9023 function parse_LABEL(blob, length, opts) {
9025 var o = parse_cell(blob, length, opts);
9027 if(opts.vers == 0x5120) {
9033 if(opts.qpro) blob.l++;
9051 function parse_STRING(blob, length, opts) {
9053 var o = parse_cell(blob, length, opts);
9055 if(opts.vers == 0x5120) {
9064 function parse_INTEGER(blob, length, opts) {
9065 var o = parse_cell(blob, length, opts);
9078 function parse_NUMBER(blob, length, opts) {
9079 var o = parse_cell(blob, length, opts);
9092 function parse_FORMULA(blob, length, opts) {
9094 var o = parse_cell(blob, length, opts);
9097 if(opts.qpro) blob.l = tgt;
9400 function parse_SHEETINFOQP(blob, length, opts) {
9401 if(!opts.qpro || length < 21) return;
9630 function qpw_to_workbook_buf(d, opts)/*:Workbook*/ {
9632 var o = opts || {};
9944 function parse_si(x, opts) { argument
9945 var html = opts ? opts.cellHTML : true;
9971 function parse_sst_xml(data/*:string*/, opts)/*:SST*/ { argument
9979 var o = parse_si(ss[i].trim(), opts);
9988 function write_sst_xml(sst/*:SST*/, opts)/*:string*/ { argument
9989 if(!opts.bookSST) return "";
10019 function parse_sst_bin(data, opts)/*:SST*/ { argument
10038 if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
10053 function write_sst_bin(sst/*::, opts*/) {
10354 function parse_XORObfuscation(blob, length, opts, out) { argument
10356 if(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);
10358 if(out.valid) out.insitu = crypto_MakeXorDecryptor(opts.password);
10369 function parse_FilePass(blob, length/*:number*/, opts) { argument
10370 var o = ({ Type: opts.biff >= 8 ? blob.read_shift(2) : 0 }/*:any*/); /* wEncryptionType */
10372 else parse_XORObfuscation(blob, opts.biff >= 8 ? length : length - 2, opts, o);
10377 function rtf_to_sheet(d, opts) { argument
10378 switch (opts.type) {
10380 return rtf_to_sheet_str(Base64_decode(d), opts);
10382 return rtf_to_sheet_str(d, opts);
10384 return rtf_to_sheet_str(has_buf && Buffer.isBuffer(d) ? d.toString("binary") : a2s(d), opts);
10386 return rtf_to_sheet_str(cc2str(d), opts);
10388 throw new Error("Unrecognized type " + opts.type);
10390 function rtf_to_sheet_str(str, opts) { argument
10391 var o = opts || {};
10444 function rtf_to_workbook(d, opts) { argument
10445 var wb = sheet_to_workbook(rtf_to_sheet(d, opts), opts);
10449 function sheet_to_rtf(ws, opts) { argument
10593 function parse_borders(t, styles, themes, opts) { argument
10660 default: if(opts && opts.WTF) {
10668 function parse_fills(t, styles, themes, opts) { argument
10726 default: if(opts && opts.WTF) {
10734 function parse_fonts(t, styles, themes, opts) { argument
10846 default: if(opts && opts.WTF) {
10854 function parse_numFmts(t, styles, opts) { argument
10876 default: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts');
10881 function write_numFmts(NF/*:{[n:number|string]:string}*//*::, opts*/) {
10895 function parse_cellXfs(t, styles, opts) { argument
10943 default: if(opts && opts.WTF) {
10970 return function parse_sty_xml(data, themes, opts) { argument
10978 if((t=data.match(numFmtRegex))) parse_numFmts(t, styles, opts);
10981 if((t=data.match(fontsRegex))) parse_fonts(t, styles, themes, opts);
10984 if((t=data.match(fillsRegex))) parse_fills(t, styles, themes, opts);
10987 if((t=data.match(bordersRegex))) parse_borders(t, styles, themes, opts);
10993 if((t=data.match(cellXfRegex))) parse_cellXfs(t, styles, opts);
11004 function write_sty_xml(wb/*:Workbook*/, opts)/*:string*/ { argument
11014 if((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);
11038 function parse_BrtFont(data, length/*:number*/, opts) { argument
11043 var grbit = parse_FontFlags(data, 2, opts);
11227 function parse_sty_bin(data, themes, opts) { argument
11283 …else if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */)) throw new Error("…
11398 function write_sty_bin(wb, opts) { argument
11406 write_CELLXFS_bin(ba, opts.cellXfs);
11423 function parse_clrScheme(t, themes, opts) { argument
11472 default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
11478 function parse_fontScheme(/*::t, themes, opts*/) { }
11481 function parse_fmtScheme(/*::t, themes, opts*/) { }
11488 function parse_themeElements(data, themes, opts) { argument
11502 m[2](t, themes, opts);
11509 function parse_theme_xml(data/*:string*/, opts) { argument
11518 parse_themeElements(t[0], themes, opts);
11523 function write_theme(Themes, opts)/*:string*/ { argument
11524 if(opts && opts.themeXLSX) return opts.themeXLSX;
11695 function parse_Theme(blob, length, opts) { argument
11699 if(!opts.cellStyles) { blob.l = end; return; }
11705 return parse_theme_xml(themeXML, opts);
11833 var opts = _opts || {};
11866 } else if (!pass || opts.WTF && state[state.length - 1] != 35)
11896 function parse_xlmeta_xml(data, name, opts) { argument
11969 if (!pass && (opts == null ? void 0 : opts.WTF))
11982 function parse_cc_xml(data/*::, name, opts*/)/*:Array<any>*/ {
11999 //function write_cc_xml(data, opts) { }
12016 function parse_cc_bin(data, name, opts) { argument
12026 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12032 //function write_cc_bin(data, opts) { }
12035 //var opts = _opts || {};
12036 //if(opts.WTF) throw "XLSX External Link";
12042 var opts = _opts || {};
12079 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12081 }, opts);
12199 function parse_comments_xml(data/*:string*/, opts)/*:Array<RawComment>*/ { argument
12218 if(opts.sheetRows && opts.sheetRows <= cell.r) return;
12224 if(opts.cellHTML) comment.h = rt.h;
12230 function write_comments_xml(data/*::, opts*/) {
12278 function parse_tcmnt_xml(data/*:string*/, opts)/*:Array<RawComment>*/ { argument
12309 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');
12316 function write_tcmnt_xml(comments, people, opts) { argument
12325 id: "{54EE7951-7262-4200-6969-" + ("000000000000" + opts.tcid++).slice(-12) + "}"
12339 function parse_people_xml(data/*:string*/, opts) { argument
12361 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');
12367 function write_people_xml(people/*, opts*/) {
12409 function parse_comments_bin(data, opts)/*:Array<RawComment>*/ { argument
12425 if(opts.sheetRows && c.rfx && opts.sheetRows <= c.rfx.r) break;
12442 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12448 function write_comments_bin(data/*::, opts*/) {
12501 function parse_ds_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { r…
12502 function parse_ds_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { r…
12503 function parse_ms_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { r…
12504 function parse_ms_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { r…
12574 function parse_RgceArea(blob, length, opts) { argument
12576 if(opts) {
12577 if(opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob, length, opts);
12578 else if(opts.biff == 12) w = 4;
12586 function parse_RgceArea_BIFF2(blob/*::, length, opts*/) {
12594 function parse_RgceAreaRel(blob, length, opts) { argument
12595 if(opts.biff < 8) return parse_RgceArea_BIFF2(blob, length, opts);
12596 var r=blob.read_shift(opts.biff == 12 ? 4 : 2), R=blob.read_shift(opts.biff == 12 ? 4 : 2);
12603 function parse_RgceLoc(blob, length, opts) { argument
12604 if(opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts);
12605 var r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);
12609 function parse_RgceLoc_BIFF2(blob/*::, length, opts*/) {
12616 function parse_RgceElfLoc(blob/*::, length, opts*/) {
12623 function parse_RgceLocRel(blob, length, opts) { argument
12624 var biff = opts && opts.biff ? opts.biff : 8;
12625 if(biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob, length, opts);
12634 function parse_RgceLocRel_BIFF2(blob/*::, length:number, opts*/) {
12645 function parse_PtgArea(blob, length, opts) { argument
12647 var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);
12652 function parse_PtgArea3d(blob, length, opts) { argument
12656 if(opts) switch(opts.biff) {
12660 var area = parse_RgceArea(blob, w, opts);
12665 function parse_PtgAreaErr(blob, length, opts) { argument
12667 blob.l += opts && (opts.biff > 8) ? 12 : (opts.biff < 8 ? 6 : 8);
12671 function parse_PtgAreaErr3d(blob, length, opts) { argument
12675 if(opts) switch(opts.biff) {
12684 function parse_PtgAreaN(blob, length, opts) { argument
12686 var area = parse_RgceAreaRel(blob, length - 1, opts);
12691 function parse_PtgArray(blob, length, opts) { argument
12693 blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
12706 function parse_PtgAttrChoose(blob, length, opts)/*:Array<number>*/ { argument
12708 var offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
12711 for(var i = 0; i <= offset; ++i) o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));
12716 function parse_PtgAttrGoto(blob, length, opts) { argument
12719 return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
12723 function parse_PtgAttrIf(blob, length, opts) { argument
12726 return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
12737 function parse_PtgAttrSemi(blob, length, opts) { argument
12739 blob.l += opts && opts.biff == 2 ? 3 : 4;
12762 function parse_PtgRef(blob, length, opts) { argument
12766 var loc = parse_RgceLoc(blob, 0, opts);
12771 function parse_PtgRefN(blob, length, opts) { argument
12774 var loc = parse_RgceLocRel(blob, 0, opts);
12779 function parse_PtgRef3d(blob, length, opts) { argument
12783 if(opts && opts.biff == 5) blob.l += 12;
12784 var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel
12790 function parse_PtgFunc(blob, length, opts) { argument
12794 var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);
12798 function parse_PtgFuncVar(blob, length, opts) { argument
12800 …var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [(type == 0x58 ? -1 : 0), blob.re…
12809 function parse_PtgAttrSum(blob, length, opts) { argument
12810 blob.l += opts && opts.biff == 2 ? 3 : 4; return;
12814 function parse_PtgExp(blob, length, opts) { argument
12816 if(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];
12818 var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
12835 function parse_PtgStr(blob, length, opts) { blob.l++; return parse_ShortXLUnicodeString(blob, lengt… argument
12867 function parse_PtgExtraMem(blob, cce, opts) { argument
12868 var count = blob.read_shift((opts.biff == 12) ? 4 : 2);
12870 …for(var i = 0; i != count; ++i) out.push(((opts.biff == 12) ? parse_UncheckedRfX : parse_Ref8U)(bl…
12875 function parse_PtgExtraArray(blob, length, opts) { argument
12877 if(opts.biff == 12) {
12884 if(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }
12887 for(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);
12892 function parse_PtgName(blob, length, opts) { argument
12894 var w = (!opts || (opts.biff >= 8)) ? 4 : 2;
12896 switch(opts.biff) {
12905 function parse_PtgNameX(blob, length, opts) { argument
12906 if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);
12912 function parse_PtgNameX_BIFF5(blob/*::, length, opts*/) {
12922 function parse_PtgMemArea(blob, length, opts) { argument
12924 blob.l += (opts && opts.biff == 2 ? 3 : 4);
12925 var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
12930 function parse_PtgMemFunc(blob, length, opts) { argument
12932 var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
12938 function parse_PtgRefErr(blob, length, opts) { argument
12941 if(opts.biff < 8) blob.l--;
12942 if(opts.biff == 12) blob.l += 2;
12947 function parse_PtgRefErr3d(blob, length, opts) { argument
12951 if(opts) switch(opts.biff) {
12966 function parse_PtgElfLoc(blob, length, opts) { argument
12968 return [parse_RgceElfLoc(blob, 4, opts)];
12970 function parse_PtgElfNoop(blob/*::, length, opts*/) {
12983 function parse_PtgElfLel(blob/*::, length, opts*/) {
13018 function parse_PtgList(blob/*::, length, opts*/) {
13029 function parse_PtgSxName(blob/*::, length, opts*/) {
13035 function parse_PtgSheet(blob, length, opts) { argument
13038 blob.l += (opts.biff == 2 ? 1 : 4);
13041 function parse_PtgEndSheet(blob, length, opts) { argument
13042 blob.l += (opts.biff == 2 ? 4 : 5);
13045 function parse_PtgMemAreaN(blob/*::, length, opts*/) {
13050 function parse_PtgMemNoMemN(blob/*::, length, opts*/) {
13055 function parse_PtgAttrNoop(blob/*::, length, opts*/) {
13171 function parse_RgbExtra(blob, length, rgce, opts) { argument
13172 if(opts.biff < 8) return parsenoop(blob, length);
13178 rgce[i][1] = parse_PtgExtraArray(blob, 0, opts);
13182 rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts);
13186 if(opts && opts.biff == 12) {
13206 function parse_Rgce(blob, length, opts) { argument
13215 else { ptgs.push([R.n, R.f(blob, length, opts)]); }
13264 function get_ixti_raw(supbooks, ixti/*:number*/, opts)/*:string*/ { argument
13266 if(opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti];
13269 if(opts.biff < 8) {
13276 if(opts.biff > 8) switch(supbooks[XTI[0]][0]) {
13281 if(opts.SID != null) return supbooks.SheetNames[opts.SID];
13298 function get_ixti(supbooks, ixti/*:number*/, opts)/*:string*/ { argument
13299 var ixtiraw = get_ixti_raw(supbooks, ixti, opts);
13300 return ixtiraw == "#REF" ? ixtiraw : formula_quote_sheet_name(ixtiraw, opts);
13302 function stringify_formula(formula/*Array<any>*/, range, cell/*:any*/, supbooks, opts)/*:string*/ { argument
13303 var biff = (opts && opts.biff) || 8;
13342 if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
13374 /*::type = f[1][0]; */c = shift_cell_xls((f[1][1]/*:any*/), _range, opts);
13378 …/*::type = f[1][0]; */c = cell ? shift_cell_xls((f[1][1]/*:any*/), cell, opts) : (f[1][1]/*:any*/);
13382 …f[1][0]; */ixti = /*::Number(*/f[1][1]/*::)*/; c = shift_cell_xls((f[1][2]/*:any*/), _range, opts);
13383 sname = get_ixti(supbooks, ixti, opts);
13412 /*::type = f[1][0]; */r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts);
13413 stack.push(encode_range_xls((r/*:any*/), opts));
13416 /*::type = f[1][0]; */r = shift_range_xls(f[1][1], _range, opts);
13417 stack.push(encode_range_xls((r/*:any*/), opts));
13421 sname = get_ixti(supbooks, ixti, opts);
13422 stack.push(sname + "!" + encode_range_xls((r/*:any*/), opts));
13438 if(name && name.slice(0,6) == "_xlfn." && !opts.xlfn) name = name.slice(6);
13446 if(opts.biff <= 5) {
13461 var ixtidata = (get_ixti_raw(supbooks, bookidx, opts)||"").split(";;");
13487 if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
13504 stack.push(stringify_formula(parsedf, _range, q, supbooks, opts));
13512 stack.push(stringify_formula(e2[1], _range, q, supbooks, opts));
13583 if(opts.biff != 3) if(last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {
13601 if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + f[1][0]);
13607 if(stack.length > 1 && opts.WTF) throw new Error("bad formula stack");
13613 function parse_ArrayParsedFormula(blob, length, opts/*::, ref*/) { argument
13614 var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
13617 var rgce = parse_Rgce(blob, cce, opts);
13618 if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
13624 function parse_XLSCellParsedFormula(blob, length, opts) { argument
13625 var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
13628 var rgce = parse_Rgce(blob, cce, opts);
13629 if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
13635 function parse_NameParsedFormula(blob, length, opts, cce) { argument
13637 var rgce = parse_Rgce(blob, cce, opts);
13639 if(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts);
13644 function parse_SharedParsedFormula(blob, length, opts) { argument
13647 var rgce = parse_Rgce(blob, cce, opts);
13649 if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);
13680 function parse_Formula(blob, length, opts) { argument
13683 if(opts.biff == 2) ++blob.l;
13686 if(opts.biff != 2) {
13688 if(opts.biff >= 5) {
13692 var cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts);
13695 function write_Formula(cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, os/*:number*/) { argument
13718 function parse_XLSBParsedFormula(data, length, opts) { argument
13720 var rgce = parse_Rgce(data, cce, opts);
13722 var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;
15172 function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) { argument
15173 var z = opts.revssf[cell.z != null ? cell.z : "General"];
15175 if(z == null && opts.ssf) {
15176 for(; i < 0x188; ++i) if(opts.ssf[i] == null) {
15179 opts.ssf[i] = cell.z;
15180 opts.revssf[cell.z] = z = i;
15196 function safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles) { argument
15198 if(opts.cellNF) p.z = table_fmt[fmtid];
15199 } catch(e) { if(opts.WTF) throw e; }
15200 if(p.t === 'z' && !opts.cellStyles) return;
15202 if((!opts || opts.cellText !== false) && p.t !== 'z') try {
15220 } catch(e) { if(opts.WTF) throw e; }
15221 if(!opts.cellStyles) return;
15226 if(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb;
15230 if(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb;
15232 } catch(e) { if(opts.WTF && styles.Fills) throw e; }
15257 function parse_ws_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*:WBWBProps*/, themes, style… argument
15260 if(DENSE != null && opts.dense == null) opts.dense = DENSE;
15263 var s = opts.dense ? ([]/*:any*/) : ({}/*:any*/);
15291 if(opts.cellStyles) {
15298 if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess, themes, styles);
15319 if(opts.sheetRows > 0 && s["!ref"]) {
15321 if(opts.sheetRows <= +tmpref.e.r) {
15322 tmpref.e.r = opts.sheetRows - 1;
15352 function write_ws_xml_sheetpr(ws, wb, idx, opts, o) { argument
15355 if(opts.bookType !== 'xlsx' && wb.vbaraw) {
15492 function write_ws_xml_sheetviews(ws, opts, idx, wb)/*:string*/ { argument
15499 function write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts/*::, idx, wb*/)/*:string*/ { argument
15501 …if((cell.v === undefined || cell.t === "z" && !(opts||{}).sheetStubs) && typeof cell.f !== "string…
15509 if(opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString();
15521 var os = get_cell_style(opts.cellXfs, cell, opts);
15531 if(opts && opts.bookSST) {
15532 v = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings));
15556 return function parse_ws_xml_data(sdata/*:string*/, s, opts, guess/*:Range*/, themes, styles) { argument
15566 var sheetStubs = !!opts.sheetStubs;
15577 if(opts && opts.cellStyles) {
15581 if(opts.sheetRows && opts.sheetRows < tagr) continue;
15594 if(opts.sheetRows && opts.sheetRows < tagr) continue;
15598 if(opts && opts.cellStyles) {
15631 if(opts.cellFormula) {
15635 if(!opts.xlfn) p.f = _xlfn(p.f);
15643 if(!opts.xlfn) ___f = _xlfn(___f);
15683 if(opts.cellHTML) p.h = sstr.h;
15689 if(opts.cellHTML) p.h = escapehtml(p.v);
15696 if(opts.cellHTML) p.h = sstr.h;
15701 if(opts.cellDates) p.v = parseDate(p.v, 1);
15706 if(!opts || opts.cellText !== false) p.w = p.v;
15716 if(opts.cellStyles) {
15721 safe_format(p, fmtid, fillid, opts, themes, styles);
15722 …if(opts.cellDates && do_format && p.t == 'n' && fmt_is_date(table_fmt[fmtid])) { p.t = 'd'; p.v = …
15723 if(tag.cm && opts.xlmeta) {
15724 var cm = (opts.xlmeta.Cell||[])[+tag.cm-1];
15737 function write_ws_xml_data(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*//*::, rels*/)/*:s… argument
15749 if((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb)) != null) r.push(cell);
15781 function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ { argument
15792 if(opts.WTF) throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576");
15801 write_ws_xml_sheetpr(ws, wb, idx, opts, o);
15805 o[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);
15808 if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {
15809 defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16',
15810 baseColWidth:opts.sheetFormat.baseColWidth||'10',
15811 outlineLevelRow:opts.sheetFormat.outlineLevelRow||'7'
15819 rdata = write_ws_xml_data(ws, opts, idx, wb, rels);
15873 …if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) o[o.length] = writetag("ignoredErrors", …
16180 function parse_BrtFmlaBool(data, length, opts) { argument
16183 cell.r = opts['!row'];
16186 if(opts.cellFormula) {
16188 var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
16189 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16196 function parse_BrtFmlaError(data, length, opts) { argument
16199 cell.r = opts['!row'];
16202 if(opts.cellFormula) {
16204 var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
16205 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16212 function parse_BrtFmlaNum(data, length, opts) { argument
16215 cell.r = opts['!row'];
16218 if(opts.cellFormula) {
16220 var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
16221 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16228 function parse_BrtFmlaString(data, length, opts) { argument
16231 cell.r = opts['!row'];
16234 if(opts.cellFormula) {
16236 var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
16237 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16254 function parse_BrtHLink(data, length/*::, opts*/) {
16279 function parse_BrtPane(/*data, length, opts*/) {
16283 function parse_BrtArrFmla(data, length, opts) { argument
16288 if(opts.cellFormula) {
16289 var formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts);
16296 function parse_BrtShrFmla(data, length, opts) { argument
16300 if(opts.cellFormula) {
16301 var formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts);
16327 function parse_BrtMargins(data/*::, length, opts*/)/*:Margins*/ {
16340 function parse_BrtBeginWsView(data/*::, length, opts*/) {
16402 function parse_BrtDVal(/*data, length, opts*/) {
16404 function parse_BrtDVal14(/*data, length, opts*/) {
16409 var opts = _opts || {};
16411 if(DENSE != null && opts.dense == null) opts.dense = DENSE;
16412 var s/*:Worksheet*/ = (opts.dense ? [] : {});
16421 opts.biff = 12;
16422 opts['!row'] = 0;
16428 var supbooks = opts.supbooks || /*::(*/wb/*:: :any)*/.supbooks || ([[]]/*:any*/);
16432 if(!opts.supbooks) {
16433 opts.supbooks = supbooks;
16451 if(opts.sheetRows && opts.sheetRows <= row.r) end=true;
16453 opts['!row'] = row.r;
16482 case 'e': p.v = val[1]; if(opts.cellText !== false) p.w = BErr[p.v]; break;
16486 if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.numFmtId,null,opts, themes, styles);
16488 if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
16490 if(opts.cellFormula) {
16506 if(opts.cellDates && cf && p.t == 'n' && fmt_is_date(table_fmt[cf.numFmtId])) {
16518 if(!opts.sheetStubs || pass) break;
16521 if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
16538 cm = ((opts.xlmeta||{}).Cell||[])[val-1];
16551 if(opts.dense) {
16564 if(!opts.cellFormula) break;
16566 cell = ((opts.dense ? s[R][C] : s[encode_col(C) + rr])/*:any*/);
16567 cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
16571 if(!opts.cellFormula) break;
16573 cell = (opts.dense ? s[R][C] : s[encode_col(C) + rr]);
16574 cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
16579 if(!opts.cellStyles) break;
16679 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
16681 }, opts);
16683 delete opts.supbooks;
16684 delete opts['!row'];
16687 if(opts.sheetRows && s["!ref"]) {
16689 if(opts.sheetRows <= +tmpref.e.r) {
16690 tmpref.e.r = opts.sheetRows - 1;
16706 function write_ws_bin_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, ws/*:W… argument
16723 o.s = get_cell_style(opts.cellXfs, cell, opts);
16727 if(opts.bookSST) {
16728 vv = get_sst_id(opts.Strings, (cell.v == null ? "" : String(cell.v)/*:any*/), opts.revStrings);
16763 function write_CELLTABLE(ba, ws/*:Worksheet*/, idx/*:number*/, opts/*::, wb:Workbook*/) { argument
16782 last_seen = write_ws_bin_cell(ba, cell, R, C, opts, ws, last_seen);
16795 function write_COLINFOS(ba, ws/*:Worksheet*//*::, idx:number, opts, wb:Workbook*/) {
16879 function write_ws_bin(idx/*:number*/, opts, wb/*:Workbook*/, rels) { argument
16885 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:XFD104857…
16897 write_COLINFOS(ba, ws, idx, opts, wb);
16898 write_CELLTABLE(ba, ws, idx, opts, wb);
16920 if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) write_IGNOREECS(ba, ws);
16955 function parse_chart(data/*:?string*/, name/*:string*/, opts, rels, wb, csheet) { argument
16980 function parse_cs_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Wor… argument
16997 //function write_cs_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
17016 function parse_cs_bin(data, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Worksheet*/ { argument
17055 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
17057 }, opts);
17062 //function write_cs_bin(/*::idx:number, opts, wb:Workbook, rels*/) {
17238 function parse_wb_xml(data, opts)/*:WorkbookFile*/ { argument
17385 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in workbook');
17396 function write_wb_xml(wb/*:Workbook*//*::, opts:?WriteOpts*/)/*:string*/ {
17548 function parse_BrtName(data, length, opts) { argument
17554 var formula = parse_XLSBNameParsedFormula(data, 0, opts);
17600 function parse_wb_bin(data, opts)/*:WorkbookFile*/ { argument
17605 if(!opts) opts = {};
17606 opts.biff = 12;
17625 if(val.Sheet != null) opts.SID = val.Sheet;
17626 val.Ref = stringify_formula(val.Ptg, null, null, supbooks, opts);
17627 delete opts.SID;
17697 …else if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */ && state[state.leng…
17699 }, opts);
17710 function write_BUNDLESHS(ba, wb/*::, opts*/) {
17746 function write_BOOKVIEWS(ba, wb/*::, opts*/) {
17811 function write_wb_bin(wb, opts) { argument
17819 write_BOOKVIEWS(ba, wb, opts);
17820 write_BUNDLESHS(ba, wb, opts);
17839 function parse_wb(data, name/*:string*/, opts)/*:WorkbookFile*/ { argument
17840 if(name.slice(-4)===".bin") return parse_wb_bin((data/*:any*/), opts);
17841 return parse_wb_xml((data/*:any*/), opts);
17844 function parse_ws(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Workshee… argument
17845 …if(name.slice(-4)===".bin") return parse_ws_bin((data/*:any*/), opts, idx, rels, wb, themes, style…
17846 return parse_ws_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);
17849 function parse_cs(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Workshee… argument
17850 …if(name.slice(-4)===".bin") return parse_cs_bin((data/*:any*/), opts, idx, rels, wb, themes, style…
17851 return parse_cs_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);
17854 function parse_ms(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Workshee… argument
17855 …if(name.slice(-4)===".bin") return parse_ms_bin((data/*:any*/), opts, idx, rels, wb, themes, style…
17856 return parse_ms_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);
17859 function parse_ds(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Workshee… argument
17860 …if(name.slice(-4)===".bin") return parse_ds_bin((data/*:any*/), opts, idx, rels, wb, themes, style…
17861 return parse_ds_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);
17864 function parse_sty(data, name/*:string*/, themes, opts) { argument
17865 if(name.slice(-4)===".bin") return parse_sty_bin((data/*:any*/), themes, opts);
17866 return parse_sty_xml((data/*:any*/), themes, opts);
17869 function parse_sst(data, name/*:string*/, opts)/*:SST*/ { argument
17870 if(name.slice(-4)===".bin") return parse_sst_bin((data/*:any*/), opts);
17871 return parse_sst_xml((data/*:any*/), opts);
17874 function parse_cmnt(data, name/*:string*/, opts)/*:Array<RawComment>*/ { argument
17875 if(name.slice(-4)===".bin") return parse_comments_bin((data/*:any*/), opts);
17876 return parse_comments_xml((data/*:any*/), opts);
17879 function parse_cc(data, name/*:string*/, opts) { argument
17880 if(name.slice(-4)===".bin") return parse_cc_bin((data/*:any*/), name, opts);
17881 return parse_cc_xml((data/*:any*/), name, opts);
17884 function parse_xlink(data, rel, name/*:string*/, opts) { argument
17885 if(name.slice(-4)===".bin") return parse_xlink_bin((data/*:any*/), rel, name, opts);
17886 return parse_xlink_xml((data/*:any*/), rel, name, opts);
17889 function parse_xlmeta(data, name/*:string*/, opts) { argument
17890 if(name.slice(-4)===".bin") return parse_xlmeta_bin((data/*:any*/), name, opts);
17891 return parse_xlmeta_xml((data/*:any*/), name, opts);
17976 function process_style_xlml(styles, stag, opts) { argument
17977 if(opts.cellStyles) {
18066 var opts = _opts || {};
18069 if(opts.type == 'binary' || opts.type == 'array' || opts.type == 'base64') {
18075 …pening.indexOf(",") & 1023), (opening.indexOf(";")&1023))) { var _o = dup(opts); _o.type = "string…
18077 if(ishtml) return html_to_workbook(str, opts);
18101 if(DENSE != null && opts.dense == null) opts.dense = DENSE;
18102 …var sheets = {}, sheetnames/*:Array<string>*/ = [], cursheet/*:Worksheet*/ = (opts.dense ? [] : {}…
18127 …length-1][0]==/*"Comment"*/"comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, arrayf, opts);
18133 if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== void 0) {
18134 if(opts.dense) {
18149 if(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; }
18155 if(opts.dense) {
18200 if(opts.sheetRows && opts.sheetRows <= refguess.e.r) {
18202 refguess.e.r = opts.sheetRows - 1;
18216 cursheet = (opts.dense ? [] : {});
18234 if(Rn[1]==='/') process_style_xlml(styles, stag, opts);
18293 if(!opts.cellStyles) break;
18389 if(state.length == 0 && Rn[3] == "document") return parse_fods(str, opts);
18391 if(state.length == 0 && Rn[3] == "uof"/*"UOF"*/) return parse_fods(str, opts);
18805 if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
18808 if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;
18818 function parse_xlml(data/*:RawBytes|string*/, opts)/*:Workbook*/ { argument
18819 fix_read_opts(opts=opts||{});
18820 switch(opts.type||"base64") {
18821 case "base64": return parse_xlml_xml(Base64_decode(data), opts);
18822 case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts);
18823 case "array": return parse_xlml_xml(a2s(data), opts);
18825 /*:: throw new Error("unsupported type " + opts.type); */
18829 function write_props_xlml(wb/*:Workbook*/, opts)/*:string*/ { argument
18832 if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));
18834 if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));
18838 function write_wb_xlml(wb/*::, opts*/)/*:string*/ {
18845 function write_sty_xlml(wb, opts)/*:string*/ { argument
18848 opts.cellXfs.forEach(function(xf, id) {
18858 function write_names_xlml(wb/*::, opts*/)/*:string*/ {
18871 function write_ws_xlml_names(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { argument
18889 function write_ws_xlml_wsopts(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { argument
19004 function write_ws_xlml_cell(cell, ref/*:string*/, ws, opts, idx/*:number*/, wb, addr)/*:string*/{ argument
19030 case 'z': if(!opts.sheetStubs) return ""; break;
19038 var os = get_cell_style(opts.cellXfs, cell, opts);
19058 function write_ws_xlml_table(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { argument
19088 row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr));
19095 function write_ws_xlml(idx/*:number*/, opts, wb/*:Workbook*/)/*:string*/ { argument
19100 var t/*:string*/ = ws ? write_ws_xlml_names(ws, opts, idx, wb) : "";
19104 t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : "";
19108 o.push(write_ws_xlml_wsopts(ws, opts, idx, wb));
19114 function write_xlml(wb, opts)/*:string*/ { argument
19115 if(!opts) opts = {};
19120 opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
19121 opts.ssf = wb.SSF;
19122 opts.cellXfs = [];
19123 get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
19126 d.push(write_props_xlml(wb, opts));
19127 d.push(write_wb_xlml(wb, opts));
19131 …d.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), {"ss:Name":escapexml(wb.SheetNames[i])})…
19132 d[2] = write_sty_xlml(wb, opts);
19133 d[3] = write_names_xlml(wb, opts);
19180 function slurp(RecordType, R, blob, length/*:number*/, opts)/*:any*/ { argument
19184 if(opts && opts.enc && opts.enc.insitu && d.length > 0) switch(RecordType) {
19190 opts.enc.insitu(d);
19213 return R.f(b, b.length, opts);
19216 function safe_format_xf(p/*:any*/, opts/*:ParseOpts*/, date1904/*:?boolean*/) { argument
19222 if(opts.cellNF) p.z = table_fmt[fmtid];
19223 } catch(e) { if(opts.WTF) throw e; }
19224 if(!opts || opts.cellText !== false) try {
19233 else p.w = SSF_format(fmtid,p.v, {date1904:!!date1904, dateNF: opts && opts.dateNF});
19234 } catch(e) { if(opts.WTF) throw e; }
19235 if(opts.cellDates && fmtid && p.t == 'n' && fmt_is_date(table_fmt[fmtid] || String(fmtid))) {
19246 var wb = ({opts:{}}/*:any*/); property in parse_workbook.wb
19296 if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts);
19307 var opts = ({ class
19321 if(options.password) opts.password = options.password;
19328 supbooks.SheetNames = opts.snames;
19329 supbooks.sharedf = opts.sharedf;
19330 supbooks.arrayf = opts.arrayf;
19340 opts.codepage = 1200;
19359 …if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt …
19366 if(RecordType === 0x000a /* EOF */) val = /*::(*/R.f(blob, length, opts)/*:: :any)*/;
19367 else val = /*::(*/slurp(RecordType, R, blob, length, opts)/*:: :any)*/;
19373 wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break;
19374 case 0x0086 /* WriteProtect */: wb.opts.WriteProtect = true; break;
19376 if(!opts.enc) blob.l = 0;
19377 opts.enc = val;
19382 case 0x005c /* WriteAccess */: opts.lastuser = val; break;
19391 set_cp(opts.codepage = cpval);
19394 case 0x013d /* RRTabId */: opts.rrtabid = val; break;
19395 case 0x0019 /* WinProtect */: opts.winlocked = val; break;
19396 case 0x01b7 /* RefreshAll */: wb.opts["RefreshAll"] = val; break;
19397 case 0x000c /* CalcCount */: wb.opts["CalcCount"] = val; break;
19398 case 0x0010 /* CalcDelta */: wb.opts["CalcDelta"] = val; break;
19399 case 0x0011 /* CalcIter */: wb.opts["CalcIter"] = val; break;
19400 case 0x000d /* CalcMode */: wb.opts["CalcMode"] = val; break;
19401 case 0x000e /* CalcPrecision */: wb.opts["CalcPrecision"] = val; break;
19402 case 0x005f /* CalcSaveRecalc */: wb.opts["CalcSaveRecalc"] = val; break;
19403 case 0x000f /* CalcRefMode */: opts.CalcRefMode = val; break; // TODO: implement R1C1
19404 case 0x08a3 /* ForceFullCalculation */: wb.opts.FullCalc = val; break;
19422 Ref: stringify_formula(val.rgce,range,null,supbooks,opts)
19432 case 0x0016 /* ExternCount */: opts.ExternCount = val; break;
19438 if(opts.biff < 8) break;
19442 …case 0x0013 /* Password */: if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); …
19445 opts.snames.push(val.name);
19472 if(opts.biff === 8) opts.biff = {
19485 opts.biffguess = val.BIFFVer == 0;
19486 …if(val.BIFFVer == 0 && val.dt == 0x1000) { opts.biff = 5; seen_codepage = true; set_cp(opts.codepa…
19487 if(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2;
19491 …if(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepag…
19493 if(opts.biff < 5 || val.BIFFVer == 0 && val.dt == 0x1000) {
19499 opts.snames.push(cur_sheet);
19506 opts.arrayf = arrayf = [];
19515 safe_format_xf(temp_val, options, wb.opts.Date1904);
19521 safe_format_xf(temp_val, options, wb.opts.Date1904);
19527 safe_format_xf(temp_val, options, wb.opts.Date1904);
19535 safe_format_xf(temp_val, options, wb.opts.Date1904);
19548 … if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
19550 } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
19553 safe_format_xf(temp_val, options, wb.opts.Date1904);
19563 … temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
19566 safe_format_xf(temp_val, options, wb.opts.Date1904);
19578 cc.f = ""+stringify_formula(val[1], range, val[0], supbooks, opts);
19589 (cc||{}).f = ""+stringify_formula(val[0], range, lastcell, supbooks, opts);
19597 safe_format_xf(temp_val, options, wb.opts.Date1904);
19603 safe_format_xf(temp_val, options, wb.opts.Date1904);
19611 safe_format_xf(temp_val, options, wb.opts.Date1904);
19620 safe_format_xf(temp_val, options, wb.opts.Date1904);
19631 if(opts.biff == 4) {
19646 case 0x005d /* Obj */: objects[val.cmo[0]] = opts.lastobj = val; break;
19647 case 0x01b6 /* TxO */: opts.lastobj.TxO = val; break;
19648 case 0x007f /* ImData */: opts.lastobj.ImData = val; break;
19665 if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */
19686 if(!opts.cellStyles) break;
19743 if(opts.enc) wb.Encryption = opts.enc;
19851 function write_xlscfb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:CFBContainer*/ { argument
19852 var o = opts || {};
21262 function write_ws_biff2_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*//*::, opts*/…
21280 function write_ws_biff2(ba/*:BufArray*/, ws/*:Worksheet*/, idx/*:number*/, opts/*::, wb:Workbook*/)… argument
21284 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
21297 write_ws_biff2_cell(ba, cell, R, C, opts);
21303 function write_biff2_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { argument
21304 var o = opts || {};
21318 function write_FONTS_biff8(ba, data, opts) { argument
21325 }, opts));
21329 function write_FMTS_biff8(ba, NF/*:?SSFTable*/, opts) { argument
21333 …r[1]; ++i) if(NF[i] != null) write_biff_rec(ba, 0x041E /* Format */, write_Format(i, NF[i], opts));
21353 function write_CELLXFS_biff8(ba, opts) { argument
21354 …= 0; i < 16; ++i) write_biff_rec(ba, 0x00e0 /* XF */, write_XF({numFmtId:0, style:true}, 0, opts));
21355 opts.cellXfs.forEach(function(c) {
21356 write_biff_rec(ba, 0x00e0 /* XF */, write_XF(c, 0, opts));
21379 function write_ws_biff8_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts) { argument
21380 var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
21385 if(cell.bf) write_biff_rec(ba, 0x0006 /* Formula */, write_Formula(cell, R, C, opts, os));
21390 write_biff_rec(ba, 0x0203 /* Number */, write_Number(R, C, v, os, opts));
21393 write_biff_rec(ba, 0x0205 /* BoolErr */, write_BoolErr(R, C, cell.v, os, opts, cell.t));
21397 if(opts.bookSST) {
21398 var isst = get_sst_id(opts.Strings, cell.v == null ? "" : String(cell.v), opts.revStrings);
21399 write_biff_rec(ba, 0x00fd /* LabelSst */, write_LabelSst(R, C, isst, os, opts));
21400 …204 /* Label */, write_Label(R, C, (cell.v == null ? "" : String(cell.v)).slice(0,255), os, opts));
21408 function write_ws_biff8(idx/*:number*/, opts, wb/*:Workbook*/) { argument
21414 var b8 = opts.biff == 8;
21419 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
21424 write_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts));
21444 write_biff_rec(ba, 0x0200 /* Dimensions */, write_Dimensions(range, opts));
21457 write_ws_biff8_cell(ba, cell, R, C, opts);
21472 write_biff_rec(ba, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts));
21481 function write_biff8_global(wb/*:Workbook*/, bufs, opts/*:WriteOpts*/) { argument
21486 var b8 = opts.biff == 8, b5 = opts.biff == 5;
21487 write_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts));
21488 if(opts.bookType == "xla") write_biff_rec(A, 0x0087 /* Addin */);
21494 write_biff_rec(A, 0x005c /* WriteAccess */, write_WriteAccess("SheetJS", opts));
21505 write_biff_rec(A, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts));
21516 write_biff_rec(A, 0x003d /* Window1 */, write_Window1(opts));
21524 write_FONTS_biff8(A, wb, opts);
21525 write_FMTS_biff8(A, wb.SSF, opts);
21526 write_CELLXFS_biff8(A, opts);
21537 if(b8 && opts.Strings) write_biff_continue(C, 0x00FC /* SST */, write_SST(opts.Strings, opts));
21549 …Sheet8 */, write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts));
21564 function write_biff8_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { argument
21565 var o = opts || {};
21591 function write_biff_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { argument
21601 var o = opts || {};
21603 case 8: case 5: return write_biff8_buf(wb, opts);
21604 case 4: case 3: case 2: return write_biff2_buf(wb, opts);
21610 var opts = _opts || {};
21611 if(DENSE != null && opts.dense == null) opts.dense = DENSE;
21612 var ws/*:Worksheet*/ = opts.dense ? ([]/*:any*/) : ({}/*:any*/);
21625 …if(hd == "<tr") { ++R; if(opts.sheetRows && opts.sheetRows <= R) { --R; break; } C = 0; continue; }
21649 if(opts.raw || !m.trim().length || _t == 's'){}
21655 if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/);
21656 o.z = opts.dateNF || table_fmt[14];
21658 if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; }
21704 function html_to_workbook(str/*:string*/, opts)/*:Workbook*/ { argument
21708 var w = sheet_to_workbook(html_to_sheet(mtch[0], opts), opts);
21713 …mtch.forEach(function(s, idx) { book_append_sheet(wb, html_to_sheet(s, opts), "Sheet" + (idx+1)); …
21723 function sheet_to_html(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*//*, wb:?Workbook*/)/*:string*/ { argument
21724 var o = opts || {};
21743 var opts = _opts || {};
21744 if(DENSE != null) opts.dense = DENSE;
21746 if(opts.origin != null) {
21747 if(typeof opts.origin == 'number') or_R = opts.origin;
21749 …var _origin/*:CellAddress*/ = typeof opts.origin == "string" ? decode_cell(opts.origin) : opts.ori…
21754 var sheetRows = Math.min(opts.sheetRows||10000000, rows.length);
21771 if (opts.display) continue;
21777 if (opts.display && is_dom_element_hidden(elt)) continue;
21791 else if(opts.raw || v.trim().length == 0 || _t == "s"){}
21797 if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/);
21798 o.z = opts.dateNF || table_fmt[14];
21809 if(opts.dense) { if(!ws[R + or_R]) ws[R + or_R] = []; ws[R + or_R][C + or_C] = o; }
21824 var opts = _opts || {};
21825 var ws/*:Worksheet*/ = opts.dense ? ([]/*:any*/) : ({}/*:any*/);
21829 function table_to_book(table/*:HTMLElement*/, opts/*:?any*/)/*:Workbook*/ { argument
21830 var o = sheet_to_workbook(parse_dom_table(table, opts), opts);
22089 var opts = _opts || {};
22090 if(DENSE != null && opts.dense == null) opts.dense = DENSE;
22098 var ws = opts.dense ? ([]/*:any*/) : ({}/*:any*/);
22125 if(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) {
22127 range.e.r = opts.sheetRows - 1;
22142 ws = opts.dense ? ([]/*:any*/) : ({}/*:any*/); merges = [];
22161 if(opts.sheetStubs) {
22162 if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = {t:'z'}; }
22173 … if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
22177 if(opts.dense) {
22198 if(opts.cellFormula) {
22230 if(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v, WB.WBProps.date1904) - baddate; }
22233 if(opts.cellDates) { q.t = 'd'; q.v = numdate(q.v); }
22251 if(textp && opts.cellText !== false) q.w = textp;
22253 if(!isstub || opts.sheetStubs) {
22254 if(!(opts.sheetRows && opts.sheetRows <= R)) {
22257 if(opts.dense) {
22602 default: if(opts.WTF) throw new Error(Rn);
22610 if(opts.bookSheets) delete /*::(*/out/*:: :any)*/.Sheets;
22614 function parse_ods(zip/*:ZIPFile*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
22615 opts = opts || ({}/*:any*/);
22616 …file(zip, 'META-INF/manifest.xml')) parse_manifest(getzipdata(zip, 'META-INF/manifest.xml'), opts);
22618 var Styles = styles && parse_ods_styles(utf8read(styles), opts);
22621 var wb = parse_content_xml(utf8read(content), opts, Styles);
22626 function parse_fods(data/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
22627 var wb = parse_content_xml(data, opts);
22633 var write_styles_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {
22660 return function wso(/*::wb, opts*/) {
22827 var write_content_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {
22839 var write_ws = function(ws, wb/*:Workbook*/, i/*:number*/, opts, nfs)/*:string*/ { argument
23002 return function wcx(wb, opts) { argument
23050 if(opts.bookType == "fods") {
23060 …0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts, nfs));
23064 if(opts.bookType == "fods") o.push('</office:document>');
23070 function write_ods(wb/*:any*/, opts/*:any*/) { argument
23071 if(opts.bookType == "fods") return write_content_ods(wb, opts);
23085 zip_add_file(zip, f, write_content_ods(wb, opts));
23091 zip_add_file(zip, f, write_styles_ods(wb, opts));
23097 zip_add_file(zip, f, XML_HEADER + write_meta_ods(/*::wb, opts*/));
23103 zip_add_file(zip, f, write_rdf(rdf/*, opts*/));
23108 zip_add_file(zip, f, write_manifest(manifest/*, opts*/));
24102 function parse_TST_TableInfoArchive(M, root, opts) { argument
24105 if (!(opts == null ? void 0 : opts.dense))
24117 function parse_TN_SheetArchive(M, root, opts) { argument
24129 out.sheets.push(parse_TST_TableInfoArchive(M, m, opts));
24134 function parse_TN_DocumentArchive(M, root, opts) { argument
24145 var root2 = parse_TN_SheetArchive(M, m, opts);
24157 function parse_numbers_iwa(cfb, opts) { argument
24205 return parse_TN_DocumentArchive(M, docroot, opts);
24351 function write_numbers_iwa(wb, opts) { argument
24352 if (!opts || !opts.numbers)
24354 var cfb = CFB.read(opts.numbers, { type: "base64" });
25024 return function fix_opts(opts) { argument
25027 if(opts[d[0]] === undefined) opts[d[0]] = d[1];
25028 if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
25033 function fix_read_opts(opts) { argument
25053 ])(opts);
25056 function fix_write_opts(opts) { argument
25067 ])(opts);
25084 …h/*:string*/, sheet, idx/*:number*/, sheetRels, sheets, stype/*:string*/, opts, wb, themes, styles… argument
25090 … case 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
25091 case 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles);
25098 …_ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, tr…
25100 … case 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
25101 … case 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
25112 comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts);
25118 tcomments = tcomments.concat(parse_tcmnt_xml(getzipdata(zip, dfile, true), opts));
25121 if(tcomments && tcomments.length) sheet_insert_comments(_ws, tcomments, true, opts.people || []);
25122 } catch(e) { if(opts.WTF) throw e; }
25127 function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25129 opts = opts || {};
25130 fix_read_opts(opts);
25133 if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
25135 if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);
25140 if(zip.FileIndex) return parse_numbers_iwa(zip, opts);
25143 return parse_numbers_iwa(_zip, opts);
25152 opts = dup(opts);
25153 delete opts.type;
25154 if(typeof index_zip.content == "string") opts.type = "binary";
25156 …d" && Buffer.isBuffer(index_zip.content)) return readSync(new Uint8Array(index_zip.content), opts);
25157 return readSync(index_zip.content, opts);
25180 if(!opts.bookSheets && !opts.bookProps) {
25182 …arse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) th…
25184 …if(opts.cellStyles && dir.themes.length) themes = parse_theme_xml(getzipstr(zip, dir.themes[0].rep…
25186 ….style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts);
25192 return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts);
25196 var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts);
25205 if(propdata) parse_ext_props(propdata, props, opts);
25210 if(!opts.bookSheets || opts.bookProps) {
25213 if(propdata) custprops = parse_cust_props(propdata, opts);
25218 if(opts.bookSheets || opts.bookProps) {
25221 if(opts.bookProps) { out.Props = props; out.Custprops = custprops; }
25222 if(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets;
25223 if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;
25228 …if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain))…
25251opts.xlmeta = parse_xlmeta(getzipdata(zip, strip_front_slash(dir.metadata[0])),dir.metadata[0],opt…
25255 opts.people = parse_people_xml(getzipdata(zip, strip_front_slash(dir.people[0])),opts);
25274 if(opts && opts.sheets != null) switch(typeof opts.sheets) {
25275 case "number": if(i != opts.sheets) continue wsloop; break;
25276 …case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop;…
25277 default: if(Array.isArray && Array.isArray(opts.sheets)) {
25279 for(var snj = 0; snj != opts.sheets.length; ++snj) {
25280 if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
25281 …if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].to…
25286 …safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, …
25302 if(opts && opts.bookFiles) {
25316 if(opts && opts.bookVBA) {
25327 var opts = _opts || {};
25364 …ypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || "", opts);
25367 …ypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || "", opts);
25371 function write_zip_xlsb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { argument
25378 opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
25379 opts.ssf = wb.SSF;
25381 opts.rels = {}; opts.wbrels = {};
25382 opts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0;
25383 if(browser_has_Map) opts.revStrings = new Map();
25384 else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }
25388 fix_write_opts(opts = opts || {});
25392 opts.cellXfs = [];
25393 get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
25398 zip_add_file(zip, f, write_core_props(wb.Props, opts));
25400 add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
25413 zip_add_file(zip, f, write_ext_props(wb.Props, opts));
25415 add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
25419 zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
25421 add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
25433 zip_add_file(zip, f, write_ws_bin(rId-1, opts, wb, wsrels));
25435 add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
25444 zip_add_file(zip, cf, write_comments_bin(comments, opts));
25459 if(opts.Strings != null && opts.Strings.length > 0) {
25461 zip_add_file(zip, f, write_sst_bin(opts.Strings, opts));
25463 add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
25467 zip_add_file(zip, f, write_wb_bin(wb, opts));
25469 add_rels(opts.rels, 1, f, RELS.WB);
25474 var ww = write_theme(wb.Themes, opts);
25477 add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
25482 zip_add_file(zip, f, write_sty_bin(wb, opts));
25484 add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
25490 add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
25496 add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
25498 zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
25499 zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
25500 zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
25502 delete opts.revssf; delete opts.ssf;
25506 function write_zip_xlsx(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { argument
25513 opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
25514 opts.ssf = wb.SSF;
25516 opts.rels = {}; opts.wbrels = {};
25517 opts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0;
25518 if(browser_has_Map) opts.revStrings = new Map();
25519 else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }
25521 var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
25523 fix_write_opts(opts = opts || {});
25527 opts.cellXfs = [];
25528 get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
25533 zip_add_file(zip, f, write_core_props(wb.Props, opts));
25535 add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
25548 zip_add_file(zip, f, write_ext_props(wb.Props, opts));
25550 add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
25554 zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
25556 add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
25560 opts.tcid = 0;
25571 zip_add_file(zip, f, write_ws_xml(rId-1, opts, wb, wsrels));
25573 add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
25587 zip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));
25593 zip_add_file(zip, cf, write_comments_xml(comments, opts));
25608 if(opts.Strings != null && opts.Strings.length > 0) {
25610 zip_add_file(zip, f, write_sst_xml(opts.Strings, opts));
25612 add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
25616 zip_add_file(zip, f, write_wb_xml(wb, opts));
25618 add_rels(opts.rels, 1, f, RELS.WB);
25623 zip_add_file(zip, f, write_theme(wb.Themes, opts));
25625 add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
25630 zip_add_file(zip, f, write_sty_xml(wb, opts));
25632 add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
25638 add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
25644 add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
25648 zip_add_file(zip, f, write_people_xml(people, opts));
25650 add_rels(opts.wbrels, -1, "persons/person.xml", RELS.PEOPLE);
25653 zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
25654 zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
25655 zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
25657 delete opts.revssf; delete opts.ssf;
25673 function read_cfb(cfb/*:CFBContainer*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25674 if(CFB.find(cfb, "EncryptedPackage")) return parse_xlsxcfb(cfb, opts);
25675 return parse_xlscfb(cfb, opts);
25678 function read_zip(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25680 var o = opts||{};
25727 function readSync(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25729 var o = opts||{};
25781 function readFileSync(filename/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25782 var o = opts||{}; o.type = 'file';
25796 function write_zip(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { argument
25797 switch(opts.bookType) {
25798 case "ods": return write_ods(wb, opts);
25799 case "numbers": return write_numbers_iwa(wb, opts);
25800 case "xlsb": return write_zip_xlsb(wb, opts);
25801 default: return write_zip_xlsx(wb, opts);
25806 function write_zip_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { argument
25807 var o = dup(opts||{});
25811 function write_zip_typeXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { argument
25812 var o = dup(opts||{});
25843 function write_cfb_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { argument
25844 var o = opts||{};
25849 function write_string_type(out/*:string*/, opts/*:WriteOpts*/, bom/*:?string*/)/*:any*/ { argument
25852 switch(opts.type) {
25856 case "file": return write_dl(opts.file, o, 'utf8');
25863 throw new Error("Unrecognized type " + opts.type);
25866 function write_stxt_type(out/*:string*/, opts/*:WriteOpts*/)/*:any*/ { argument
25867 switch(opts.type) {
25871 case "file": return write_dl(opts.file, out, 'binary');
25877 throw new Error("Unrecognized type " + opts.type);
25881 function write_binary_type(out, opts/*:WriteOpts*/)/*:any*/ { argument
25882 switch(opts.type) {
25889 …return opts.type == 'base64' ? Base64_encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr;
25890 case "file": return write_dl(opts.file, out);
25892 default: throw new Error("Unrecognized type " + opts.type);
25896 function writeSyncXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/) { argument
25899 var o = dup(opts||{});
25905 function writeSync(wb/*:Workbook*/, opts/*:?WriteOpts*/) { argument
25908 var o = dup(opts||{});
25965 function writeFileSync(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) { argument
25966 var o = opts||{}; o.type = 'file';
25972 function writeFileSyncXLSX(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) { argument
25973 var o = opts||{}; o.type = 'file';
25980 function writeFileAsync(filename/*:string*/, wb/*:Workbook*/, opts/*:?WriteFileOpts*/, cb/*:?(e?:Er… argument
25981 var o = opts||{}; o.type = 'file';
25985 var _cb = cb; if(!(_cb instanceof Function)) _cb = (opts/*:any*/);
26033 function sheet_to_json(sheet/*:Worksheet*/, opts/*:?Sheet2JSONOpts*/) { argument
26037 var o = opts || {};
26112 function sheet_to_csv(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/)/*:string*/ { argument
26114 var o = opts == null ? {} : opts;
26137 function sheet_to_txt(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { argument
26138 if(!opts) opts = {}; opts.FS = "\t"; opts.RS = "\n";
26139 var s = sheet_to_csv(sheet, opts);
26140 if(typeof $cptable == 'undefined' || opts.type == 'string') return s;
26179 function sheet_add_json(_ws/*:?Worksheet*/, js/*:Array<any>*/, opts)/*:Worksheet*/ { argument
26180 var o = opts || {};
26248 function json_to_sheet(js/*:Array<any>*/, opts)/*:Worksheet*/ { return sheet_add_json(null, js, opt… argument
26411 function write_csv_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { argument
26413 var o = opts == null ? {} : opts;
26442 function write_html_stream(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*/) { argument
26445 var o = opts || {};
26468 function write_json_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { argument
26474 var o = opts || {};