version bump 0.15.5: sheets option

This commit is contained in:
SheetJS 2020-01-27 20:20:38 -05:00
parent 6551dd0e05
commit a81bb78f18
21 changed files with 188 additions and 68 deletions

@ -1682,6 +1682,7 @@ The exported `read` and `readFile` functions accept an options argument:
|`bookVBA` | false | If true, copy VBA blob to `vbaraw` field ** |
|`password` | "" | If defined and file is encrypted, use password ** |
|`WTF` | false | If true, throw errors on unexpected file features ** |
|`sheets` | | If specified, only parse specified sheets ** |
- Even if `cellNF` is false, formatted text will be generated and saved to `.w`
- In some cases, sheets may be parsed even if `bookSheets` is false.
@ -1695,6 +1696,10 @@ The exported `read` and `readFile` functions accept an options argument:
* `cfb` object for formats using CFB containers
- `sheetRows-1` rows will be generated when looking at the JSON object output
(since the header row is counted as a row when parsing the data)
- By default all worksheets are parsed. `sheets` restricts based on input type:
* number: zero-based index of worksheet to parse (`0` is first worksheet)
* string: name of worksheet to parse (case insensitive)
* array of numbers and strings to select multiple worksheets.
- `bookVBA` merely exposes the raw VBA CFB object. It does not parse the data.
XLSM and XLSB store the VBA CFB object in `xl/vbaProject.bin`. BIFF8 XLS mixes
the VBA entries alongside the core Workbook entry, so the library generates a

@ -1 +1 @@
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';

@ -152,7 +152,7 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -164,6 +164,18 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -180,11 +192,11 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
Themes: themes,
SSF: SSF.get_table()
}/*:any*/);
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

6
dist/xlsx.core.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.core.min.map generated vendored

File diff suppressed because one or more lines are too long

20
dist/xlsx.extendscript.js generated vendored

@ -9160,7 +9160,7 @@ module.exports = ZStream;
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -29545,7 +29545,7 @@ function parse_zip(zip, opts) {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -29557,6 +29557,18 @@ function parse_zip(zip, opts) {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -29573,11 +29585,11 @@ function parse_zip(zip, opts) {
Themes: themes,
SSF: SSF.get_table()
});
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

4
dist/xlsx.full.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.full.min.map generated vendored

File diff suppressed because one or more lines are too long

20
dist/xlsx.js generated vendored

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -20389,7 +20389,7 @@ function parse_zip(zip, opts) {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -20401,6 +20401,18 @@ function parse_zip(zip, opts) {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -20417,11 +20429,11 @@ function parse_zip(zip, opts) {
Themes: themes,
SSF: SSF.get_table()
});
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

26
dist/xlsx.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.min.map generated vendored

File diff suppressed because one or more lines are too long

4
dist/xlsx.mini.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.mini.min.map generated vendored

File diff suppressed because one or more lines are too long

@ -23,6 +23,7 @@ The exported `read` and `readFile` functions accept an options argument:
|`bookVBA` | false | If true, copy VBA blob to `vbaraw` field ** |
|`password` | "" | If defined and file is encrypted, use password ** |
|`WTF` | false | If true, throw errors on unexpected file features ** |
|`sheets` | | If specified, only parse specified sheets ** |
- Even if `cellNF` is false, formatted text will be generated and saved to `.w`
- In some cases, sheets may be parsed even if `bookSheets` is false.
@ -36,6 +37,10 @@ The exported `read` and `readFile` functions accept an options argument:
* `cfb` object for formats using CFB containers
- `sheetRows-1` rows will be generated when looking at the JSON object output
(since the header row is counted as a row when parsing the data)
- By default all worksheets are parsed. `sheets` restricts based on input type:
* number: zero-based index of worksheet to parse (`0` is first worksheet)
* string: name of worksheet to parse (case insensitive)
* array of numbers and strings to select multiple worksheets.
- `bookVBA` merely exposes the raw VBA CFB object. It does not parse the data.
XLSM and XLSB store the VBA CFB object in `xl/vbaProject.bin`. BIFF8 XLS mixes
the VBA entries alongside the core Workbook entry, so the library generates a

@ -1538,6 +1538,7 @@ The exported `read` and `readFile` functions accept an options argument:
|`bookVBA` | false | If true, copy VBA blob to `vbaraw` field ** |
|`password` | "" | If defined and file is encrypted, use password ** |
|`WTF` | false | If true, throw errors on unexpected file features ** |
|`sheets` | | If specified, only parse specified sheets ** |
- Even if `cellNF` is false, formatted text will be generated and saved to `.w`
- In some cases, sheets may be parsed even if `bookSheets` is false.
@ -1551,6 +1552,10 @@ The exported `read` and `readFile` functions accept an options argument:
* `cfb` object for formats using CFB containers
- `sheetRows-1` rows will be generated when looking at the JSON object output
(since the header row is counted as a row when parsing the data)
- By default all worksheets are parsed. `sheets` restricts based on input type:
* number: zero-based index of worksheet to parse (`0` is first worksheet)
* string: name of worksheet to parse (case insensitive)
* array of numbers and strings to select multiple worksheets.
- `bookVBA` merely exposes the raw VBA CFB object. It does not parse the data.
XLSM and XLSB store the VBA CFB object in `xl/vbaProject.bin`. BIFF8 XLS mixes
the VBA entries alongside the core Workbook entry, so the library generates a

@ -1,6 +1,6 @@
{
"name": "xlsx",
"version": "0.15.4",
"version": "0.15.5",
"author": "sheetjs",
"description": "SheetJS Spreadsheet data parser and writer",
"keywords": [

51
types/index.d.ts vendored

@ -29,6 +29,12 @@ export const stream: StreamUtils;
/** Number Format (either a string or an index to the format table) */
export type NumberFormat = string | number;
/** Worksheet specifier (string, number, worksheet) */
export type WSSpec = string | number | WorkSheet;
/** Range specifier (string or range or cell), single-cell lifted to range */
export type RangeSpec = string | Range | CellAddress;
/** Basic File Properties */
export interface Properties {
/** Summary tab "Title" */
@ -94,12 +100,24 @@ export interface CommonOptions {
*/
cellDates?: boolean;
/**
* Create cell objects for stub cells
* @default false
*/
sheetStubs?: boolean;
/**
* When reading a file, save style/theme info to the .s field
* When writing a file, export style/theme info
* @default false
*/
cellStyles?: boolean;
/**
* If defined and file is encrypted, use password
* @default ''
*/
password?: string;
}
export interface DateNFOption {
@ -142,12 +160,6 @@ export interface ParsingOptions extends CommonOptions {
/** Override default date format (code 14) */
dateNF?: string;
/**
* Create cell objects for stub cells
* @default false
*/
sheetStubs?: boolean;
/**
* If >0, read the first sheetRows rows
* @default 0
@ -178,11 +190,8 @@ export interface ParsingOptions extends CommonOptions {
*/
bookSheets?: boolean;
/**
* If defined and file is encrypted, use password
* @default ''
*/
password?: string;
/** If specified, only parse the specified sheets or sheet names */
sheets?: number | string | Array<number | string>;
/* If true, plaintext parsing will not parse values */
raw?: boolean;
@ -474,6 +483,7 @@ export interface AutoFilterInfo {
/** Range of the AutoFilter table */
ref: string;
}
export type WSKeys = SheetKeys | ColInfo[] | RowInfo[] | Range[] | ProtectInfo | AutoFilterInfo;
/** Worksheet Object */
@ -500,6 +510,13 @@ export interface WorkSheet extends Sheet {
'!autofilter'?: AutoFilterInfo;
}
/**
* Worksheet Object with CellObject type
*
* The normal Worksheet type uses indexer of type `any` -- this enforces CellObject
*/
export interface StrictWS { [addr: string]: CellObject; }
/**
* The Excel data type for a cell.
* b Boolean, n Number, e error, s String, d Date, z Stub
@ -521,6 +538,12 @@ export interface Comment {
t: string;
}
/** Cell comments */
export interface Comments extends Array<Comment> {
/** Hide comment by default */
hidden?: boolean;
}
/** Link object */
export interface Hyperlink {
/** Target of the link (HREF) */
@ -557,7 +580,7 @@ export interface CellObject {
h?: string;
/** Comments associated with the cell */
c?: Comment[];
c?: Comments;
/** Number format string associated with the cell (if requested) */
z?: NumberFormat;
@ -577,9 +600,7 @@ export interface CellAddress {
r: number;
}
/**
* Range object (representing ranges like "A1:B2")
*/
/** Range object (representing ranges like "A1:B2") */
export interface Range {
/** Starting cell */
s: CellAddress;

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
@ -20508,7 +20508,7 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -20520,6 +20520,18 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -20536,11 +20548,11 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
Themes: themes,
SSF: SSF.get_table()
}/*:any*/);
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

20
xlsx.js generated

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -20389,7 +20389,7 @@ function parse_zip(zip, opts) {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -20401,6 +20401,18 @@ function parse_zip(zip, opts) {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -20417,11 +20429,11 @@ function parse_zip(zip, opts) {
Themes: themes,
SSF: SSF.get_table()
});
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
@ -7773,7 +7773,7 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -7785,6 +7785,18 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -7801,11 +7813,11 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
Themes: themes,
SSF: SSF.get_table()
}/*:any*/);
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.15.4';
XLSX.version = '0.15.5';
var current_codepage = 1200, current_ansi = 1252;
var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
@ -7681,7 +7681,7 @@ function parse_zip(zip, opts) {
/* Numbers iOS hack */
var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
for(i = 0; i != props.Worksheets; ++i) {
wsloop: for(i = 0; i != props.Worksheets; ++i) {
var stype = "sheet";
if(wbrels && wbrels[i]) {
path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
@ -7693,6 +7693,18 @@ function parse_zip(zip, opts) {
path = path.replace(/sheet0\./,"sheet.");
}
relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
if(opts && opts.sheets != null) switch(typeof opts.sheets) {
case "number": if(i != opts.sheets) continue wsloop; break;
case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;
default: if(Array.isArray && Array.isArray(opts.sheets)) {
var snjseen = false;
for(var snj = 0; snj != opts.sheets.length; ++snj) {
if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1;
if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;
}
if(!snjseen) continue wsloop;
}
}
safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
}
@ -7709,11 +7721,11 @@ function parse_zip(zip, opts) {
Themes: themes,
SSF: SSF.get_table()
});
if(opts.bookFiles) {
if(opts && opts.bookFiles) {
out.keys = entries;
out.files = zip.files;
}
if(opts.bookVBA) {
if(opts && opts.bookVBA) {
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
}