- Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Since parse might be used in some pipeline operation, not all these pipelines are promise-friendly.
And this method could have been sync:
public async parseFiles( filePathes: string[], rootPath: string): Promise<File[]> { return filePathes .map((o) => { let scriptKind: ScriptKind = ScriptKind.Unknown; const parsed = parse(o); switch (parsed.ext.toLowerCase()) { case 'js': scriptKind = ScriptKind.JS; break; case 'jsx': scriptKind = ScriptKind.JSX; break; case 'ts': scriptKind = ScriptKind.TS; break; case 'tsx': scriptKind = ScriptKind.TSX; break; } return createSourceFile( o, readFileSync(o).toString(), ScriptTarget.ES2015, true, scriptKind, ); }) .map(o => this.parseTypescript(o, rootPath)); }
edalex-ian
Metadata
Metadata
Assignees
Labels
No labels