Skip to content

Commit de263c0

Browse files
devpaulblakeembrey
authored andcommitted
Update to TypeScript 2.2.1 (#448)
1 parent ff74d2b commit de263c0

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
],
2929
"engines": {
30-
"node": ">= 4"
30+
"node": ">= 4.2.0"
3131
},
3232
"dependencies": {
3333
"@types/fs-extra": "0.0.33",
@@ -46,7 +46,7 @@
4646
"progress": "^1.1.8",
4747
"shelljs": "^0.7.0",
4848
"typedoc-default-themes": "^0.4.2",
49-
"typescript": "2.1.6"
49+
"typescript": "2.2.1"
5050
},
5151
"devDependencies": {
5252
"@types/mocha": "^2.2.39",

src/lib/utils/options/declaration.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class OptionDeclaration {
4646

4747
scope: ParameterScope;
4848

49-
map: Object;
49+
protected map: Object | Map<string, any> | 'object';
5050

5151
mapError: string;
5252

@@ -92,10 +92,14 @@ export class OptionDeclaration {
9292
}
9393
break;
9494
case ParameterType.Map:
95-
if (this.map !== 'object') {
95+
const map = this.map;
96+
if (map !== 'object') {
9697
const key = value ? (value + '').toLowerCase() : '';
97-
if (key in this.map) {
98-
value = this.map[key];
98+
99+
if (map instanceof Map && map.has(key)) {
100+
value = map.get(key);
101+
} else if (key in map) {
102+
value = map[key];
99103
} else if (errorCallback) {
100104
if (this.mapError) {
101105
errorCallback(this.mapError);

src/lib/utils/options/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class Options extends ChildableComponent<Application, OptionsComponent> {
151151
for (let key in obj) {
152152
const value = obj[key];
153153
const declaration = this.getDeclaration(key);
154-
const shouldValueBeAnObject = declaration && declaration.map === 'object';
154+
const shouldValueBeAnObject = declaration && declaration['map'] === 'object';
155155
if (typeof value === 'object' && !shouldValueBeAnObject) {
156156
this.setValues(value, prefix + key + '.', errorCallback);
157157
} else {

src/test/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function getFileIndex(base, dir: string = '', results: string[] = []) {
2020
function compareDirectories(a, b) {
2121
const aFiles = getFileIndex(a);
2222
const bFiles = getFileIndex(b);
23-
Assert.deepEqual(aFiles, bFiles, 'Generated files differ.');
23+
Assert.deepEqual(aFiles, bFiles, `Generated files differ. between "${ a }" and "${ b }"`);
2424

2525
const gitHubRegExp = /https:\/\/github.com\/[A-Za-z0-9\-]+\/typedoc\/blob\/[^\/]*\/examples/g;
2626
aFiles.forEach(function (file) {

tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4+
"lib": [
5+
"DOM",
6+
"ES5",
7+
"ES2015.Collection"
8+
],
49
"target": "ES5",
510
"noImplicitAny": false,
611
"removeComments": true,

0 commit comments

Comments
 (0)