From c7d8948756f2f5bd9e11a206c5c115ada7690f6b Mon Sep 17 00:00:00 2001 From: Lennart Jansson Date: Tue, 22 Nov 2016 13:12:09 -0800 Subject: [PATCH] Support baseUrl and paths compiler options --- src/lib/utils/options/declaration.ts | 18 ++++++++++-------- src/lib/utils/options/options.ts | 4 +++- src/lib/utils/options/sources/typescript.ts | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/lib/utils/options/declaration.ts b/src/lib/utils/options/declaration.ts index 6089ac92b..7afae4480 100644 --- a/src/lib/utils/options/declaration.ts +++ b/src/lib/utils/options/declaration.ts @@ -97,14 +97,16 @@ export class OptionDeclaration value = value || ""; break; case ParameterType.Map: - var key = value ? (value + "").toLowerCase() : ''; - if (key in this.map) { - value = this.map[key]; - } else if (errorCallback) { - if (this.mapError) { - errorCallback(this.mapError); - } else { - errorCallback('Invalid value for option "%s".', this.name); + if (this.map !== 'object') { + var key = value ? (value + "").toLowerCase() : ''; + if (key in this.map) { + value = this.map[key]; + } else if (errorCallback) { + if (this.mapError) { + errorCallback(this.mapError); + } else { + errorCallback('Invalid value for option "%s".', this.name); + } } } break; diff --git a/src/lib/utils/options/options.ts b/src/lib/utils/options/options.ts index 9359bc329..cf423f2a0 100644 --- a/src/lib/utils/options/options.ts +++ b/src/lib/utils/options/options.ts @@ -168,7 +168,9 @@ export class Options extends ChildableComponent setValues(obj:Object, prefix:string = '', errorCallback?:Function) { for (var key in obj) { var value = obj[key]; - if (typeof value === 'object') { + var declaration = this.getDeclaration(key); + var shouldValueBeAnObject = declaration && declaration.map === 'object'; + if (typeof value === 'object' && !shouldValueBeAnObject) { this.setValues(value, prefix + key + '.', errorCallback); } else { this.setValue(prefix + key, value, errorCallback); diff --git a/src/lib/utils/options/sources/typescript.ts b/src/lib/utils/options/sources/typescript.ts index 07a2946e6..8aef32263 100644 --- a/src/lib/utils/options/sources/typescript.ts +++ b/src/lib/utils/options/sources/typescript.ts @@ -20,7 +20,7 @@ export class TypeScriptSource extends OptionsComponent 'watch', 'declaration', 'mapRoot', 'sourceMap', 'inlineSources', 'removeComments', // Ignore new TypeScript 2.0 options until typedoc can't manage it. - 'baseUrl', 'paths', 'lib', 'strictNullChecks', 'noImplicitThis', + 'lib', 'strictNullChecks', 'noImplicitThis', 'traceResolution', 'noUnusedParameters', 'noUnusedLocals', 'skipLibCheck', 'declarationDir', 'types', 'typeRoots' ];