Skip to content

Commit 26b162d

Browse files
lennartjanssonblakeembrey
authored andcommitted
Support baseUrl and paths compiler options (#342)
1 parent 2fd8687 commit 26b162d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/lib/utils/options/declaration.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,16 @@ export class OptionDeclaration
9797
value = value || "";
9898
break;
9999
case ParameterType.Map:
100-
var key = value ? (value + "").toLowerCase() : '';
101-
if (key in this.map) {
102-
value = this.map[key];
103-
} else if (errorCallback) {
104-
if (this.mapError) {
105-
errorCallback(this.mapError);
106-
} else {
107-
errorCallback('Invalid value for option "%s".', this.name);
100+
if (this.map !== 'object') {
101+
var key = value ? (value + "").toLowerCase() : '';
102+
if (key in this.map) {
103+
value = this.map[key];
104+
} else if (errorCallback) {
105+
if (this.mapError) {
106+
errorCallback(this.mapError);
107+
} else {
108+
errorCallback('Invalid value for option "%s".', this.name);
109+
}
108110
}
109111
}
110112
break;

src/lib/utils/options/options.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ export class Options extends ChildableComponent<Application, OptionsComponent>
168168
setValues(obj:Object, prefix:string = '', errorCallback?:Function) {
169169
for (var key in obj) {
170170
var value = obj[key];
171-
if (typeof value === 'object') {
171+
var declaration = this.getDeclaration(key);
172+
var shouldValueBeAnObject = declaration && declaration.map === 'object';
173+
if (typeof value === 'object' && !shouldValueBeAnObject) {
172174
this.setValues(value, prefix + key + '.', errorCallback);
173175
} else {
174176
this.setValue(prefix + key, value, errorCallback);

src/lib/utils/options/sources/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class TypeScriptSource extends OptionsComponent
2020
'watch', 'declaration', 'mapRoot',
2121
'sourceMap', 'inlineSources', 'removeComments',
2222
// Ignore new TypeScript 2.0 options until typedoc can't manage it.
23-
'baseUrl', 'paths', 'lib', 'strictNullChecks', 'noImplicitThis',
23+
'lib', 'strictNullChecks', 'noImplicitThis',
2424
'traceResolution', 'noUnusedParameters', 'noUnusedLocals',
2525
'skipLibCheck', 'declarationDir', 'types', 'typeRoots'
2626
];

0 commit comments

Comments
 (0)