Skip to content

Commit 698bc9c

Browse files
committed
0.4.2 - Upgrade to TypeScript 3.1, update dependencies, remove compiled bin tarball in favor of git tags.
1 parent 41e334c commit 698bc9c

19 files changed

+126
-114
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ This project does its best to adhere to [Semantic Versioning](http://semver.org/
44

55

66
--------
7-
### [0.4.1](N/A) - 2018-06-22
7+
### [0.4.2](N/A) - 2018-10-17
8+
#### Changed
9+
* Update to TypeScript 3.1
10+
* Update dev dependencies and @types
11+
* Enable `tsconfig.json` `strict` and fix compile errors
12+
* Removed compiled bin tarball in favor of git tags
13+
14+
15+
--------
16+
### [0.4.1](https://github.com/TeamworkGuy2/excel-builder-ts/commit/41e334ce51bf376b53f4a7eee86efcffe6835bc7) - 2018-06-22
817
#### Added
918
* Support for worksheet `<autoFilter>` and workbook `<definedName name="_FilterDatabase">` which add filter/search dropdowns on column header cells
1019

bin/excel-builder-ts-0.4.0.tgz

-31.6 KB
Binary file not shown.

bin/excel-builder-ts-0.4.1.tgz

-32.2 KB
Binary file not shown.

drawings/Drawing.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var Drawing = /** @class */ (function () {
1212
* @constructor
1313
*/
1414
function Drawing() {
15+
this.anchor = null;
1516
this.id = Util._uniqueId("Drawing");
1617
}
1718
/**
@@ -24,16 +25,12 @@ var Drawing = /** @class */ (function () {
2425
cfg.drawing = this;
2526
switch (type) {
2627
case "absoluteAnchor":
27-
this.anchor = new AbsoluteAnchor(cfg);
28-
break;
28+
return this.anchor = new AbsoluteAnchor(cfg);
2929
case "oneCellAnchor":
30-
this.anchor = new OneCellAnchor(cfg);
31-
break;
30+
return this.anchor = new OneCellAnchor(cfg);
3231
case "twoCellAnchor":
33-
this.anchor = new TwoCellAnchor(cfg);
34-
break;
32+
return this.anchor = new TwoCellAnchor(cfg);
3533
}
36-
return this.anchor;
3734
};
3835
return Drawing;
3936
}());

drawings/Drawing.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import TwoCellAnchor = require("./TwoCellAnchor");
1010
* @module Excel/Drawing
1111
*/
1212
abstract class Drawing implements Drawings.Drawing {
13-
anchor: Drawing.AnchorLike;
13+
anchor: Drawing.AnchorLike | null = null;
1414
id: string;
1515

1616

@@ -32,16 +32,12 @@ abstract class Drawing implements Drawings.Drawing {
3232
cfg.drawing = this;
3333
switch (type) {
3434
case "absoluteAnchor":
35-
this.anchor = new AbsoluteAnchor(cfg);
36-
break;
35+
return this.anchor = new AbsoluteAnchor(cfg);
3736
case "oneCellAnchor":
38-
this.anchor = new OneCellAnchor(cfg);
39-
break;
37+
return this.anchor = new OneCellAnchor(cfg);
4038
case "twoCellAnchor":
41-
this.anchor = new TwoCellAnchor(<{ from: Util.OffsetConfig; to: Util.OffsetConfig; }><any>cfg);
42-
break;
39+
return this.anchor = new TwoCellAnchor(<{ from: Util.OffsetConfig; to: Util.OffsetConfig; }><any>cfg);
4340
}
44-
return this.anchor;
4541
}
4642

4743

drawings/Picture.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ var Util = require("../util/Util");
33
var Drawing = require("./Drawing");
44
var Picture = /** @class */ (function () {
55
function Picture() {
6+
this.anchor = null;
7+
this.description = null;
68
this.media = null;
79
this.id = Util._uniqueId("Picture");
810
this.pictureId = Util.uniqueId("Picture");
@@ -85,7 +87,13 @@ var Picture = /** @class */ (function () {
8587
// </a:ext>
8688
// </a:extLst>
8789
// </xdr:spPr>
88-
return this.anchor.toXML(xmlDoc, pictureNode);
90+
var ach = this.anchor;
91+
if (ach == null) {
92+
throw new Error("picture " + this.id + " anchor null, cannot conver to XML");
93+
}
94+
else {
95+
return ach.toXML(xmlDoc, pictureNode);
96+
}
8997
};
9098
Picture.Cctor = (function () {
9199
var thisProto = Picture.prototype;

drawings/Picture.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Picture implements Drawings.Drawing {
1010
Object.assign(Picture.prototype, thisProto);
1111
} ());
1212

13-
anchor: Drawing.AnchorLike;
14-
description: string;
13+
anchor: Drawing.AnchorLike | null = null;
14+
description: string | null;
1515
fill: any;
1616
id: string;
1717
media: any;
@@ -20,6 +20,7 @@ class Picture implements Drawings.Drawing {
2020

2121

2222
constructor() {
23+
this.description = null;
2324
this.media = null;
2425
this.id = Util._uniqueId("Picture");
2526
this.pictureId = Util.uniqueId("Picture");
@@ -126,7 +127,13 @@ class Picture implements Drawings.Drawing {
126127
// </a:extLst>
127128
// </xdr:spPr>
128129

129-
return this.anchor.toXML(xmlDoc, pictureNode);
130+
var ach = this.anchor;
131+
if (ach == null) {
132+
throw new Error("picture " + this.id + " anchor null, cannot conver to XML");
133+
}
134+
else {
135+
return ach.toXML(xmlDoc, pictureNode);
136+
}
130137
}
131138

132139
}

export/ZipWorker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
onmessage = function (event) {
23
importScripts(event.data.ziplib);
34
var zip = new JSZip();

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
{
22
"name": "excel-builder-ts",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "TypeScript Port of the excel-builder.js Library - 'A way to build excel files with javascript'",
55
"author": "TeamworkGuy2",
66
"homepage": "https://github.com/TeamworkGuy2/excel-builder-ts",
77
"license": "MIT",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/TeamworkGuy2/ts-simplog.git"
10+
"url": "https://github.com/TeamworkGuy2/excel-builder-ts.git"
1111
},
1212
"dependencies": {},
1313
"devDependencies": {
14-
"@types/chai": "~4.1.2",
15-
"@types/mocha": "~5.0.0",
16-
"chai": "~4.1.2",
17-
"mocha": "~5.0.5",
18-
"typescript": "~2.8.0"
14+
"@types/chai": "~4.1.6",
15+
"@types/mocha": "~5.2.5",
16+
"chai": "~4.2.0",
17+
"mocha": "~5.2.0",
18+
"typescript": "~3.1.3"
1919
},
2020
"scripts": {
21-
"build-package": "node ../package-tarball/index.js -exclude \\excel-builder-orig\\",
2221
"test": "mocha -u tdd --recursive",
2322
"tsc": "tsc"
2423
}

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
"lib": ["es2017", "dom", "dom.iterable"],
66
"module": "commonjs",
77
"noEmitOnError": true,
8-
"noImplicitAny": true,
98
"noImplicitReturns": true,
10-
"noImplicitThis": true,
119
"removeComments": false,
1210
"sourceMap": false,
13-
"strictNullChecks": true,
11+
"strict": true,
1412
"target": "es5"
1513
}
1614
}

0 commit comments

Comments
 (0)