Lines Matching refs:new

160 …return nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buff…
175 if(has_buf) return Buffer.alloc ? Buffer.alloc(len) : new Buffer(len);
176 return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len);
182 if(has_buf) return Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : new Buffer(len);
183 return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len);
194 var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
205 if(typeof Uint8Array === 'undefined') throw new Error("Unsupported");
206 return new Uint8Array(data);
210 if(typeof ArrayBuffer == 'undefined') throw new Error("Unsupported");
211 if(data instanceof ArrayBuffer) return ab2a(new Uint8Array(data));
212 /*:: if(data instanceof ArrayBuffer) throw new Error("unreachable"); */
213 var o = new Array(data.length);
222 var o = new Uint8Array(maxlen);
227 else if(typeof bufs[i] == "string") o.set(new Uint8Array(s2a(bufs[i])), maxlen);
228 else o.set(new Uint8Array(bufs[i]), maxlen);
477 var d = new Date(1900, 0, 1);
491 var SSFbasedate = /*#__PURE__*/new Date(1899, 11, 31, 0, 0, 0);
493 var SSFbase1904 = /*#__PURE__*/new Date(1900, 2, 1, 0, 0, 0);
559 throw new Error("unsupported value in General format: " + v);
804 throw new Error("unsupported format |" + fmt + "|");
857 /*:: if(!Array.isArray(r)) throw new Error("unreachable"); */
860 /*:: if(!Array.isArray(r)) throw new Error("unreachable"); */
921 throw new Error("unsupported format |" + fmt + "|");
939 if(in_str === true) throw new Error("Format |" + fmt + "| unterminated string ");
993 if(!SSF_isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt);
1062 …if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c) === -1) throw new Error('unrecognized charac…
1212 if(fmt.length > 4) throw new Error("cannot find right format for |" + fmt.join("|") + "|");
1332 return new RegExp("^" + fmt + "$");
1345 …var datestr = (("" + (Y>=0?Y: new Date().getFullYear())).slice(-4) + "-" + ("00" + (m>=1?m:1)).sli…
1410 var c = 0, table/*:Array<number>*/ = new Array(256);
1425 return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
1430 … table/*:Array<number>*/ = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(40…
1528 if(typeof date === "string") date = new Date(date);
1543 var val = new Date();
1575 if(p.mtime) p.mt = new Date(p.mtime*1000);
1596 if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
1618 default: throw new Error("Major Version: Expected 3 or 4 saw " + mver);
1630 if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);
1718 case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;
1719 case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;
1720 default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);
1797 if(cnt !== 0) throw new Error("DIFAT chain shorter than expected");
1820 if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
1845 if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
1908 …return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)…
1926 return parse(/*::typeof blob == 'string' ? new Buffer(blob, 'utf-8') : */blob, options);
1933 if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
1969 var now = new Date(1987, 1, 19), j = 0;
2104 /*:: if(file.content == null) throw new Error("unreachable"); */
2116 /*:: if(file.content == null) throw new Error("unreachable"); */
2156 /*:: if(!file.content) throw new Error("unreachable"); */
2171 /*:: if(!file.content) throw new Error("unreachable"); */
2240 …/*:: if(typeof Buffer == 'undefined' || !Buffer.isBuffer(o) || !(o instanceof Buffer)) throw new E…
2245 var out = new Array(o.length);
2266 var InflRaw = new InflateRaw();
2267 InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);
2269 else throw new Error("zlib does not expose bytesRead");
2275 var InflRaw = new InflateRaw();
2296 var bitswap8 = use_typed_arrays ? new Uint8Array(1<<8) : [];
2371 var a = new Uint8Array(M);
2382 var o = new Array(n);
2391 var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
2397 var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L); // []
2426 var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512);
2427 var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
2446 var DST_LN_RE = use_typed_arrays ? new Uint8Array(0x8000) : [];
2453 var LEN_LN_RE = use_typed_arrays ? new Uint8Array(0x103) : [];
2475 var addrs = use_typed_arrays ? new Uint16Array(0x8000) : [];
2564 var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
2565 var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
2566 var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);
2578 var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);
2581 var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
2582 var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
2730 else throw new Error(msg);
2794 if(flags & 0x2041) throw new Error("Unsupported ZIP encryption");
2824 default: throw new Error("Unsupported ZIP Compression method " + meth);
3059 default: throw new Error("Unsupported Content-Transfer-Encoding " + cte);
3066 …if(a2s(file.slice(0,13)).toLowerCase() != "mime-version:") throw new Error("Unsupported MAD header…
3087 if(!mboundary) throw new Error("MAD cannot find boundary");
3175 /*:: if(!file) throw new Error("unreachable"); */
3250 case "utf8": payload = new TextEncoder(enc).encode(payload); break;
3253 default: throw new Error("Unsupported encoding " + enc);
3261 var blob = new Blob([blobify(data)], {type:"application/octet-stream"});
3275 /*:: if(document.body == null) throw new Error("unreachable"); */
3277 /*:: if(document.body == null) throw new Error("unreachable"); */ document.body.removeChild(a);
3290 throw new Error("cannot save file " + fname);
3304 throw new Error("Cannot access file " + path);
3339 var basedate = /*#__PURE__*/new Date(1899, 11, 30, 0, 0, 0); // 2209161600000
3346 var refdate = /*#__PURE__*/new Date();
3350 var out = new Date();
3362 if(!m) throw new Error("|" + s + "| is not an ISO8601 Duration");
3369 throw new Error("Unsupported ISO Duration Field: " + m[i].slice(m[i].length-1));
3375 if(!time) throw new Error("Unsupported ISO Duration Field: M");
3385 var good_pd_date_1 = /*#__PURE__*/new Date('2017-02-19T19:06:09.000Z');
3386 var good_pd_date = /*#__PURE__*/isNaN(/*#__PURE__*/good_pd_date_1.getFullYear()) ? /*#__PURE__*/new
3390 var d = new Date(str);
3404 var out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));
3405 if(str.indexOf("Z") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);
3421 …if(arr[0] == 0xFF && arr[1] == 0xFE) return utf8write(new TextDecoder("utf-16le").decode(arr.slice…
3422 …if(arr[0] == 0xFE && arr[1] == 0xFF) return utf8write(new TextDecoder("utf-16be").decode(arr.slice…
3433 if(Array.isArray(arr)) arr = new Uint8Array(arr);
3434 …return new TextDecoder("latin1").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g, function(c)…
3445 if(o instanceof Date) return new Date(o.getTime());
3471 if(!M[2]) return new Date(1899,11,30,(+M[1]%12) + (M[7] == "p" ? 12 : 0), 0, 0, 0);
3473 …if(M[4]) return new Date(1899,11,30,(+M[1]%12) + (M[7] == "p" ? 12 : 0), +M[2], +M[4], parseFloat(…
3474 … else return new Date(1899,11,30,(M[7] == "p" ? 12 : 0), +M[1], +M[2], parseFloat(M[3])*1000);
3476 …else if(M[5]) return new Date(1899,11,30, (+M[1]%12) + (M[7] == "p" ? 12 : 0), +M[2], +M[5], M[6] …
3477 else return new Date(1899,11,30,(+M[1]%12) + (M[7] == "p" ? 12 : 0), +M[2], 0, 0);
3486 var o = new Date(s), n = new Date(NaN);
3545 if(o == null) throw new Error("Cannot find file " + file + " in zip");
3579 //else if(typeof TextEncoder !== "undefined") res = new TextEncoder().encode(content);
3596 throw new Error("Unrecognized type " + o.type);
3704 //default: throw new Error("Invalid xsd:boolean " + value);
3780 …return (mtcache[t] = new RegExp('<(?:\\w+:)?'+f+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)<…
3788 ].map(function(x/*:[string, string]*/) { return [new RegExp('&' + x[0] + ';', "ig"), x[1]]; });
3791 // Remove new lines and spaces from start of content
3793 // Remove new lines and spaces from end of content
3797 // Replace remaining new lines and spaces with space
3799 // Replace <br> tags with new lines
3811 return (vt_cache[bt] = new RegExp("<(?:vt:)?" + bt + ">([\\s\\S]*?)</(?:vt:)?" + bt + ">", 'g') );
3820 if(opts.WTF) throw new Error("unexpected vector length " + matches.length + " != " + h.size);
3848 throw new Error("Unable to serialize " + s);
3856 throw new Error("Bad input format: expected Buffer or string");
4076 /*:: if(typeof val !== 'string') throw new Error("unreachable"); */
4082 /*:: if(typeof val !== "string") throw new Error("unreachable"); */
4096 /*:: if(typeof val !== 'string') throw new Error("unreachable"); */
4098 /*:: if(typeof val !== 'string') throw new Error("unreachable"); */
4104 /*:: if(typeof val !== "string") throw new Error("unreachable"); */
4108 /*:: if(typeof val !== "string") throw new Error("unreachable"); */
4132 if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);
4184 // workaround for new Buffer(3).slice(0,0) bug in bun 0.1.3
4278 function encode_col(col/*:number*/)/*:string*/ { if(col < 0) throw new Error("invalid column " + co…
4325 if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
4409 if(!Array.isArray(data[R])) throw new Error("aoa_to_sheet expects an array of arrays");
4598 else throw new Error("unsupported RkNumber " + data); // TODO
4676 /* if(!fValidRGB) throw new Error("invalid"); */
4756 if (m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16));
5330 if(ct.xmlns !== XMLNS.CT) throw new Error("Unknown Namespace: " + ct.xmlns);
5506 if(rels['!id'][relobj.Id]) throw new Error("Cannot rewrite rId " + rId);
5522 …if(FEtag.path == '/' && FEtag.type !== CT_ODS) throw new Error("This OpenDocument is not a spreads…
5528 throw new Error("Unsupported ODS Encryption");
5594 var r = new Array(CORE_PROPS.length);
5598 r[i] = new RegExp("<" + g + "[^>]*>([\\s\\S]*?)<\/" + g + ">");
5729 var cur = data.match(new RegExp("<" + f[0] + "[^>]*>([\\s\\S]*?)<\/" + f[0] + ">"));
5806 } else if(opts.WTF) throw new Error(x);
5880 case 'date': m = new Date(m).toISOString().replace(/\.\d*Z/,"Z"); break;
5884 else if(m instanceof Date) m = new Date(m).toISOString().replace(/\.\d*Z/,"");
5926 …return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toIS…
5929 var date = (typeof time == "string") ? new Date(Date.parse(time)) : time;
5962 function parse_VtUnalignedString(blob, t/*:number*/) { if(!t) throw new Error("VtUnalignedString mu…
6040 …ype)===-1 && !((type & 0xFFFE) == 0x101E && (t & 0xFFFE) == 0x101E)) throw new Error('Expected typ…
6057 default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t);
6076 default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + value);
6105 …if(fail) throw new Error("Read Error: Expected address " + Props[i][1] + ' at ' + blob.l + ' :' + …
6135 default: throw new Error("Unsupported CodePage: " + PropH[piddsi.n]);
6163 default: throw new Error("unparsed value: " + blob[blob.l]);
6262 …if(CLSID !== CFB.utils.consts.HEADER_CLSID && CLSID !== clsid) throw new Error("Bad PropertySet CL…
6264 if(NumSets !== 1 && NumSets !== 2) throw new Error("Unrecognized #Sets: " + NumSets);
6267 …if(NumSets === 1 && Offset0 !== blob.l) throw new Error("Length mismatch: " + Offset0 + " !== " + …
6278 if(blob.l !== Offset1) throw new Error("Length mismatch 2: " + blob.l + " !== " + Offset1);
6313 if(target !== blob.l) throw new Error("Slurp error");
6457 if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
6461 if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker");
6472 default: throw new Error("Unsupported Moniker " + clsid);
6494 if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
6607 if(cb !== l) throw new Error("Malformed AddinUdf: padding = " + l + " != " + cb);
6702 if(blob.l != tgt) blob.l = tgt; //throw new Error("bad Object Ft-sequence");
6721 default: if(length > 6) throw new Error("Unexpected BIFF Ver " + o.BIFFVer);
6736 default: throw new Error("unsupported BIFF version");
6868 if(header.type != 0x08A3) throw new Error("Invalid Future Record " + header.type);
7054 if(blob.l !== target) throw new Error("MulRK read error");
7056 if(rkrecs.length != lastcol - col + 1) throw new Error("MulRK length mismatch");
7065 if(blob.l !== target) throw new Error("MulBlank read error");
7067 if(ixfes.length != lastcol - col + 1) throw new Error("MulBlank length mismatch");
7150 if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|"));
7201 if(cch < 0x01 || cch >0xff) throw new Error("Unexpected SupBook type: "+cch);
7223 //else throw new Error("unsupported SupBook cch: " + opts.sbcch);
7263 if(blob.l != target) throw new Error("Bad ExternSheet: " + blob.l + " != " + target);
7405 if(blob.l-s != blob.lens[i]) throw new Error("TxO: bad continue record");
7412 throw new Error("cchText: " + cchText + " != " + texts.length);
7420 // if(cchText2 !== cchText) throw new Error("TxOLastRun mismatch: " + cchText2 + " " + cchText);
7422 // if(s + length != blob.l) throw new Error("TxO " + (s + length) + ", at " + blob.l);
7731 default: throw new Error("DBF Unsupported Version: " + ft.toString(16));
7747 …//if(memo && ((flags & 0x02) === 0)) throw new Error("DBF Flags " + flags.toString(16) + " ft " + …
7794 default: throw new Error('Unknown Field Type: ' + field.type);
7799 if(d.read_shift(1) !== 0x0D) throw new Error("DBF Terminator not found " + d.l + " " + d[d.l]);
7824 if(s.length === 8) out[R][C] = new Date(+s.slice(0,4), +s.slice(4,6)-1, +s.slice(6,8));
7833 default: throw new Error("DBF Unrecognized L:|" + s + "|");
7836 if(!memo) throw new Error("DBF Unexpected MEMO for type " + ft.toString(16));
7845 out[R][C] = new Date(dd.read_shift(-8, 'f') - 0x388317533400);
7847 …case 'T': out[R][C] = new Date((dd.read_shift(4) - 0x253D8C) * 0x5265C00 + dd.read_shift(4)); brea…
7856 default: throw new Error("DBF Unsupported data type " + fields[C].type);
7860 …if(ft != 0x02) if(d.l < d.length && d[d.l++] != 0x1A) throw new Error("DBF EOF Marker missing " + …
7892 if(o.type == "string") throw new Error("Cannot write DBF to JS string");
7902 …if(typeof headers[i] !== 'string') throw new Error("DBF Invalid column name " + headers[i] + " |" …
8045 …var sylk_char_regex = new RegExp("\u001BN(" + keys(sylk_escapes).join("|").replace(/\|\|\|/, "|\\|…
8057 throw new Error("Unrecognized type " + opts.type);
8134 default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
8144 if(C_seen_E) throw new Error("SYLK shared formula cannot have own formula");
8146 if(!shrbase || !shrbase[1]) throw new Error("SYLK shared formula cannot find base");
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);
8293 throw new Error("Unrecognized type " + opts.type);
8309 else if (data !== 'EOD') throw new Error("Unrecognized DIF special command " + data);
8662 default: throw new Error("Unrecognized type " + opts.type);
8752 …if(d.length >= 16 && d[14] == 0x05 && d[15] === 0x6c) throw new Error("Unsupported Works 3 for Mac…
8849 } else throw new Error("Unrecognized LOTUS BOF " + d[2]);
8869 if(o.type == "string") throw new Error("Cannot write WK1 to JS string");
8903 if(o.type == "string") throw new Error("Cannot write WK3 to JS string");
9874 if(y[0].charCodeAt(1) !== 47 && !pass) throw new Error('Unrecognized rich format ' + y[0]);
10038 if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
10099 if(blob.l != end) throw new Error("Bad DataSpaceMapEntry: " + blob.l + " != " + end);
10141 if(blob.read_shift(4) != 0x04) throw new Error("Bad !Primary record");
10159 if(!valid) throw new Error("Encryption Flags/AlgID mismatch");
10188 throw new Error("ECMA-376 Encrypted file unrecognized Version: " + vers.Minor);
10194 if((flags & 0x3F) != 0x24) throw new Error("EncryptionInfo mismatch");
10202 function parse_EncInfoExt(/*::blob, vers*/) { throw new Error("File is password-protected: ECMA-376…
10232 if(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);
10233 …if(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Ma…
10388 throw new Error("Unrecognized type " + opts.type);
10395 throw new Error("RTF missing table");
10661 if(!pass) throw new Error('unrecognized ' + y[0] + ' in borders');
10727 if(!pass) throw new Error('unrecognized ' + y[0] + ' in fills');
10825 if(!icv) icv = XLSIcv[1]; //throw new Error(x); // note: 206 is valid
10847 if(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts');
10876 default: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts');
10944 if(!pass) throw new Error('unrecognized ' + y[0] + ' in cellXfs');
11283 …else if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */)) throw new Error("…
11472 default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
11501 if(!(t=data.match(m[1]))) throw new Error(m[0] + ' not found in themeElements');
11517 if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme');
11748 default: throw new Error("Unrecognized ExtProp type: " + extType + " " + cb);
11867 throw new Error("Unexpected record 0x" + RT.toString(16));
11970 throw new Error("unrecognized " + y[0] + " in metadata");
12026 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12079 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12309 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');
12361 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');
12442 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
12861 default: throw new Error("Bad SerAr: " + val[0]); /* Unreachable */
13200 //if(target !== blob.l && blob.l !== target - length) throw new Error(target + " != " + blob.l);
13342 if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
13487 if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
13576 throw new Error("Unsupported ELFs");
13579 throw new Error('Unrecognized Formula Token: ' + String(f));
13580 default: throw new Error('Unrecognized Formula Token: ' + String(f));
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");
15238 …if(range.e.c < range.s.c || range.e.r < range.s.r) throw new Error("Bad range (" + i + "): " + ws[…
15530 if(cell.v.length > 32767) throw new Error("Text length must not exceed 32767 characters");
15792 if(opts.WTF) throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576");
16507 …var _d = SSF_parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,…
16679 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
16885 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:XFD104857…
17055 else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16));
17198 if(n.length > 31) { if(safe) return false; throw new Error("Sheet names cannot exceed 31 chars"); }
17202 if(!safe) throw new Error("Sheet name cannot contain : \\ / ? * [ ]");
17210 for(var j = 0; j < i; ++j) if(n == N[j]) throw new Error("Duplicate Sheet Name: " + n);
17213 if(cn.charCodeAt(0) == 95 && cn.length > 22) throw new Error("Bad Code Name: Worksheet" + cn);
17218 if(!wb || !wb.SheetNames || !wb.Sheets) throw new Error("Invalid Workbook");
17219 if(!wb.SheetNames.length) throw new Error("Workbook is empty");
17239 if(!data) throw new Error("Could not find file");
17385 default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in workbook');
17389 if(XMLNS_main.indexOf(wb.xmlns) === -1) throw new Error("Unknown Namespace: " + wb.xmlns);
17697 …BrtACBegin */ && state[state.length-1] != 0x0023 /* BrtFRTBegin */)) throw new Error("Unexpected r…
17949 default: throw new Error("bad custprop:" + cp[0]);
17971 …var _d = SSF_parse_date_code(cell.v); if(_d) { cell.t = 'd'; cell.v = new Date(_d.y, _d.m-1,_d.d,_…
18010 cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
18122 if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
18196 if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
18225 if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
18326 if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
18332 if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
18343 if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
18355 if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
18381 if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
18825 /*:: throw new Error("unsupported type " + opts.type); */
18860 /*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error("unreachable"); */
18874 /*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error("unreachable"); */
19034 …case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z |…
19236 …var _d = SSF_parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,…
19359 …if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt …
19378 if(!options.password) throw new Error("File is password-protected");
19379 if(val.valid == null) throw new Error("Encryption scheme unsupported");
19380 if(!val.valid) throw new Error("Password is incorrect");
19569 } else throw new Error("String record expects Formula");
19810 if(CFB.find(cfb, '/encryption')) throw new Error("File is password-protected");
19836 …else if((_data=CFB.find(cfb, 'MN0')) && _data.content) throw new Error("Unsupported Works 4 for Ma…
19837 else throw new Error("Cannot find Workbook stream");
19862 default: throw new Error("invalid type " + o.bookType + " for XLS CFB");
21284 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
21309 …if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw new Error("Sheet not found: " + o.s…
21419 …if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
21554 if(blen != b.length) throw new Error("BS8 " + blen + " != " + b.length);
21606 throw new Error("invalid type " + o.bookType + " for BIFF");
21615 if(!mtch) throw new Error("Invalid HTML: could not find <table>");
21706 if(!mtch || mtch.length == 0) throw new Error("Invalid HTML: could not find <table>");
21803 * TODO: The right way to process relative links is to make a new <a> */
22240 } else throw new Error('Unsupported value type ' + q.t);
22602 default: if(opts.WTF) throw new Error(Rn);
22620 if(!content) throw new Error("Missing content.xml in ODS / UOF file");
23123 …if ((typeof Buffer.from == "function" ? Buffer.from([72, 62]) : new Buffer([72, 62])) instanceof U…
23133 return new DataView(array.buffer, array.byteOffset, array.byteLength);
23136 return typeof TextDecoder != "undefined" ? new TextDecoder().decode(u8) : utf8read(a2s(u8));
23139 return typeof TextEncoder != "undefined" ? new TextEncoder().encode(str) : s2a(utf8write(str));
23158 var out = new Uint8Array(len);
23219 var usz = new Uint8Array(7);
23355 … throw new Error("PB Type ".concat(type, " for Field ").concat(num, " at offset ").concat(off));
23439 throw new Error("Unexpected Snappy chunk type ".concat(type));
23482 throw new Error("Invalid offset 0");
23492 throw new Error("Invalid offset beyond length");
23517 throw new Error("Unexpected length: ".concat(chunks.reduce(function(acc, u8) {
23524 buf = new Uint8Array(buf);
23535 throw new Error("data is not a valid framed stream!");
23543 var frame = new Uint8Array(4);
23550 out.push(new Uint8Array([c - 1 << 2]));
23553 out.push(new Uint8Array([240, c - 1 & 255]));
23556 out.push(new Uint8Array([244, c - 1 & 255, c - 1 >> 8 & 255]));
23559 out.push(new Uint8Array([248, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255]));
23562 …out.push(new Uint8Array([252, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255, c - 1 >>> 24 & 255…
23694 var ridx = -1, sidx = -1, zidx = -1, ieee = NaN, dt = new Date(2001, 0, 1);
23754 throw new Error("Unsupported cell type ".concat(buf[subarray](0, 4)));
23758 throw new Error("Unsupported cell type ".concat(buf[subarray](0, 4)));
23771 var ridx = -1, sidx = -1, zidx = -1, d128 = NaN, ieee = NaN, dt = new Date(2001, 0, 1);
23822 …throw new Error("Unsupported cell type ".concat(buf[1], " : ").concat(fields & 31, " : ").concat(b…
23837 var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, flags = 0;
23869 var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, flags = 0;
23911 throw new Error("Unsupported payload version ".concat(buf[0]));
23961 throw new Error("2000 unexpected reference to ".concat(mtype));
24029 throw new Error("Duplicate cell r=".concat(x.R, " c=").concat(C));
24042 throw new Error("Invalid row varint ".concat(pb[6][0].data));
24045 throw new Error("Invalid col varint ".concat(pb[7][0].data));
24065 throw new Error("6001 unexpected reference to ".concat(mtype2));
24088 throw new Error("Expected merge type 6144, found ".concat(mtype));
24113 throw new Error("6000 unexpected reference to ".concat(mtype));
24139 throw new Error("Keynote presentations are not supported");
24153 throw new Error("Empty NUMBERS file");
24162 throw new Error("Unsupported password protection");
24187 throw new Error("File has no messages");
24189 throw new Error("Pages documents are not supported");
24199 throw new Error("Document has multiple roots");
24204 throw new Error("Cannot find Document root");
24213 [{ type: 2, data: new Uint8Array([]) }],
24214 [{ type: 2, data: new Uint8Array(Array.from({ length: 510 }, function() {
24218 [{ type: 2, data: new Uint8Array([]) }],
24219 [{ type: 2, data: new Uint8Array(Array.from({ length: 510 }, function() {
24228 var new_7 = new Uint8Array(2 * data.length);
24233 var new_4 = new Uint8Array(2 * data.length);
24268 throw new Error("Unsupported value " + data[C]);
24306 throw new Error("Too many messages");
24353 throw new Error("Must pass a `numbers` option -- check the README");
24361 throw new Error("Template NUMBERS file must have exactly one sheet");
24584 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24585 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24647 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24648 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24707 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24708 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24903 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24904 [{ type: 2, data: new Uint8Array([2, 0, 0]) }],
24946 store[10] = [{ type: 2, data: new Uint8Array([]) }];
24962 [{ type: 5, data: new Uint8Array(new Uint16Array([m.s.r, m.s.c]).buffer) }]
24966 …[{ type: 5, data: new Uint8Array(new Uint16Array([m.e.r - m.s.r + 1, m.e.c - m.s.c + 1]).buffer) }]
25102 default: throw new Error("Unrecognized sheet type " + stype);
25138 …if(typeof Uint8Array == "undefined") throw new Error('NUMBERS file parsing requires Uint8Array sup…
25145 throw new Error('Unsupported NUMBERS file');
25148 if(safegetzipfile(zip, 'index.xml.gz')) throw new Error('Unsupported NUMBERS 08 file');
25149 if(safegetzipfile(zip, 'index.xml')) throw new Error('Unsupported NUMBERS 09 file');
25156 …if(typeof Bun !== "undefined" && Buffer.isBuffer(index_zip.content)) return readSync(new Uint8Arra…
25159 throw new Error('Unsupported ZIP file');
25172 if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook");
25331 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25336 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25339 throw new Error("ECMA-376 Encrypted file bad " + f);
25343 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25346 throw new Error("ECMA-376 Encrypted file bad " + f);
25350 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25355 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25360 …data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missi…
25368 throw new Error("File is password-protected");
25383 if(browser_has_Map) opts.revStrings = new Map();
25518 if(browser_has_Map) opts.revStrings = new Map();
25668 default: throw new Error("Unrecognized type " + (o && o.type || "undefined"));
25703 default: throw new Error("Unrecognized type " + o.type);
25731 …if(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Arr…
25742 var ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo="bar";
25751 …if(n[1] === 0x49 && n[2] === 0x2a && n[3] === 0x00) throw new Error("TIFF Image File is not a spre…
25770 …case 0x89: if(n[1] === 0x50 && n[2] === 0x4E && n[3] === 0x47) throw new Error("PNG Image File is …
25771 case 0x08: if(n[1] === 0xE7) throw new Error("Unsupported Multiplan 1.x file!"); break;
25773 if(n[1] === 0xEC) throw new Error("Unsupported Multiplan 2.x file!");
25774 if(n[1] === 0xED) throw new Error("Unsupported Multiplan 3.x file!");
25790 case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
25791 default: throw new Error("Unrecognized type " + o.type);
25824 case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
25827 default: throw new Error("Unrecognized type " + o.type);
25833 out = new Uint8Array(s2ab(out));
25859 else if(typeof TextEncoder !== "undefined") return new TextEncoder().encode(o);
25863 throw new Error("Unrecognized type " + opts.type);
25877 throw new Error("Unrecognized type " + opts.type);
25892 default: throw new Error("Unrecognized type " + opts.type);
25915 if(!wb.SheetNames[idx]) throw new Error("Sheet not found: " + o.sheet + " : " + (typeof o.sheet));
25947 default: throw new Error ("Unrecognized bookType |" + o.bookType + "|");
26015 default: throw new Error('unrecognized type ' + val.t);
26119 var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");
26272 throw new Error("Cannot find sheet # " + sh);
26276 throw new Error("Cannot find sheet name |" + sh + "|");
26277 } else throw new Error("Cannot find sheet |" + sh + "|");
26289 if(!name || wb.SheetNames.length >= 0xFFFF) throw new Error("Too many worksheets");
26297 …if(wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already e…
26315 default: throw new Error("Bad sheet visibility setting " + vis);
26418 var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");