Support baseUrl and paths compiler options (#342)
This commit is contained in:
committed by
Blake Embrey
parent
2fd8687d9e
commit
26b162dcd5
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user