Support baseUrl and paths compiler options (#342)

This commit is contained in:
lennartjansson
2016-12-23 06:05:36 -08:00
committed by Blake Embrey
parent 2fd8687d9e
commit 26b162dcd5
3 changed files with 14 additions and 10 deletions

View File

@@ -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;

View File

@@ -168,7 +168,9 @@ export class Options extends ChildableComponent<Application, OptionsComponent>
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);

View File

@@ -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'
];