fix(packages): use ES modules for primary build (#11120)
This commit is contained in:

committed by
Victor Berchet

parent
8cb1046ce9
commit
979657989b
@ -6,10 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ReflectorHostContext} from '@angular/compiler-cli/src/reflector_host';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ReflectorHostContext} from '../src/reflector_host';
|
||||
|
||||
export type Entry = string | Directory;
|
||||
|
||||
export interface Directory { [name: string]: Entry; }
|
||||
@ -61,6 +60,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 +125,6 @@ export class MockCompilerHost implements ts.CompilerHost {
|
||||
useCaseSensitiveFileNames(): boolean { return false; }
|
||||
|
||||
getNewLine(): string { return '\n'; }
|
||||
|
||||
getDirectories(path: string): string[] { return this.context.getDirectories(path); }
|
||||
}
|
||||
|
Reference in New Issue
Block a user