-
-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathrun.ts
More file actions
17 lines (14 loc) · 648 Bytes
/
run.ts
File metadata and controls
17 lines (14 loc) · 648 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as path from "path";
import * as ts from "typescript";
import * as tstl from "../../src";
import { normalizeSlashes } from "../../src/utils";
export function transpileFilesResult(rootNames: string[], options: tstl.CompilerOptions) {
options.skipLibCheck = true;
options.types = [];
const emittedFiles: ts.OutputFile[] = [];
const { diagnostics } = tstl.transpileFiles(rootNames, options, (fileName, text, writeByteOrderMark) => {
const name = normalizeSlashes(path.relative(__dirname, fileName));
emittedFiles.push({ name, text, writeByteOrderMark });
});
return { diagnostics, emittedFiles };
}