Skip to content

Commit

Permalink
version bump 0.15.2: actually pass lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SheetJSDev committed Nov 15, 2019
1 parent 96e44a5 commit 1a5bba2
Show file tree
Hide file tree
Showing 49 changed files with 1,586 additions and 1,198 deletions.
4 changes: 4 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ ChakraCore
Duktape
Goja
Nashorn
QuickJS

- demos/angular/README.md
AngularJS
Expand Down Expand Up @@ -146,6 +147,9 @@ Preact
- demos/server/README.md
hapi

- demos/showcase/README.md
vscode-data-preview

- demos/xhr/README.md
axios
superagent
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ The [`demos` directory](demos/) includes sample projects for:
- [`"serverless" functions`](demos/function/)
- [`internet explorer`](demos/oldie/)

Other examples are included in the [showcase](demos/showcase/).

### Optional Modules

<details>
Expand Down Expand Up @@ -298,7 +300,7 @@ operations generally should be straightforward to implement.

Excel pushes the XLSX format as default starting in Excel 2007. However, there
are other formats with more appealing properties. For example, the XLSB format
is spiritually similar to XLSX but files often end up taking less than half the
is spiritually similar to XLSX but files often tend up taking less than half the
space and open much faster! Even though an XLSX writer is available, other
format writers are available so users can take advantage of the unique
characteristics of each format.
Expand Down Expand Up @@ -1978,7 +1980,7 @@ default column order is determined by the first appearance of the field using
<details>
<summary><b>Examples</b> (click to show)</summary>

The original sheet cannot be reproduced in the obvious way since JS object keys
The original sheet cannot be reproduced using plain objects since JS object keys
must be unique. After replacing the second `e` and `S` with `e_1` and `S_1`:

```js
Expand Down
2 changes: 1 addition & 1 deletion bits/01_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
XLSX.version = '0.15.1';
XLSX.version = '0.15.2';
8 changes: 4 additions & 4 deletions bits/22_xmlutils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
var attregexg=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
var tagregex=/<[\/\?]?[a-zA-Z0-9:]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s?[\/\?]?>/g;
var tagregex=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s?[\/\?]?>/g;

if(!(XML_HEADER.match(tagregex))) tagregex = /<[^>]*>/g;
var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ {
function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/, skip_LC/*:?boolean*/)/*:any*/ {
var z = ({}/*:any*/);
var eq = 0, c = 0;
for(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;
Expand All @@ -22,13 +22,13 @@ function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ {
if(j===q.length) {
if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods
z[q] = v;
z[q.toLowerCase()] = v;
if(!skip_LC) z[q.toLowerCase()] = v;
}
else {
var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1);
if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods
z[k] = v;
z[k.toLowerCase()] = v;
if(!skip_LC) z[k.toLowerCase()] = v;
}
}
return z;
Expand Down
18 changes: 13 additions & 5 deletions bits/23_binutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,19 @@ function WriteShift(t/*:number*/, val/*:string|number*/, f/*:?string*/)/*:any*/
for(i = 0; i != val.length; ++i) __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i);
size = 2 * val.length;
} else if(f === 'sbcs') {
/* TODO: codepage */
/*:: if(typeof val !== 'string') throw new Error("unreachable"); */
val = val.replace(/[^\x00-\x7F]/g, "_");
/*:: if(typeof val !== 'string') throw new Error("unreachable"); */
for(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF);
if(typeof cptable !== 'undefined' && current_ansi == 874) {
/* TODO: use tables directly, don't encode */
/*:: if(typeof val !== "string") throw new Error("unreachable"); */
for(i = 0; i != val.length; ++i) {
var cppayload = cptable.utils.encode(current_ansi, val.charAt(i));
this[this.l + i] = cppayload[0];
}
} else {
/*:: if(typeof val !== 'string') throw new Error("unreachable"); */
val = val.replace(/[^\x00-\x7F]/g, "_");
/*:: if(typeof val !== 'string') throw new Error("unreachable"); */
for(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF);
}
size = val.length;
} else if(f === 'hex') {
for(; i < t; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions bits/25_cellutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function shift_range_xls(cell, range, opts) {
}

function encode_cell_xls(c/*:CellAddress*/, biff/*:number*/)/*:string*/ {
if(c.cRel && c.c < 0) { c = dup(c); c.c += (biff > 8) ? 0x4000 : 0x100; }
if(c.rRel && c.r < 0) { c = dup(c); c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); }
if(c.cRel && c.c < 0) { c = dup(c); while(c.c < 0) c.c += (biff > 8) ? 0x4000 : 0x100; }
if(c.rRel && c.r < 0) { c = dup(c); while(c.r < 0) c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); }
var s = encode_cell(c);
if(!c.cRel && c.cRel != null) s = fix_col(s);
if(!c.rRel && c.rRel != null) s = fix_row(s);
Expand Down
4 changes: 2 additions & 2 deletions bits/31_rels.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function get_rels_path(file/*:string*/)/*:string*/ {
}

function parse_rels(data/*:?string*/, currentFilePath/*:string*/) {
if (!data) return data;
var rels = {"!id":{}};
if (!data) return rels;
if (currentFilePath.charAt(0) !== '/') {
currentFilePath = '/'+currentFilePath;
}
var rels = {};
var hash = {};

(data.match(tagregex)||[]).forEach(function(x) {
Expand Down
4 changes: 4 additions & 0 deletions bits/39_xlsbiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ function write_Window2(view) {
return o;
}

/* [MS-XLS] 2.4.189 TODO */
function parse_Pane(/*blob, length, opts*/) {
}

/* [MS-XLS] 2.4.122 TODO */
function parse_Font(blob, length, opts) {
var o/*:any*/ = {
Expand Down
Loading

0 comments on commit 1a5bba2

Please sign in to comment.