fixes for tsc 2.0

This commit is contained in:
Jason Choi
2016-08-16 15:51:27 -07:00
parent 4e2bb7e2b7
commit fef78646b7
3 changed files with 22 additions and 2 deletions

View File

@ -61,6 +61,15 @@ export class MockContext implements ReflectorHostContext {
}
return current;
}
getDirectories(path: string): string[] {
const dir = this.getEntry(path);
if (typeof dir !== 'object') {
return [];
} else {
return Object.keys(dir).filter(key => typeof dir[key] === 'object');
}
}
}
function normalize(parts: string[]): string[] {
@ -117,4 +126,8 @@ export class MockCompilerHost implements ts.CompilerHost {
useCaseSensitiveFileNames(): boolean { return false; }
getNewLine(): string { return '\n'; }
getDirectories(path: string): string[] {
return this.context.getDirectories(path);
}
}