Move handeling to a diffrent function, and remove specialized serialization

This commit is contained in:
Mohamed Hegazy
2015-08-25 17:42:39 -07:00
parent 16a6de281c
commit 509232f477
2 changed files with 61 additions and 80 deletions

View File

@@ -233,45 +233,7 @@ namespace ts {
outDir: "built",
rootDir: ".",
sourceMap: false,
}
/* @internal */
export function scriptTargetToString(target: ScriptTarget): string {
switch (target) {
case ScriptTarget.ES5:
return "es5";
case ScriptTarget.ES6:
return "es6";
default:
return "es3";
}
}
/* @internal */
export function moduleKindToString(kind: ModuleKind): string {
switch (kind) {
case ModuleKind.None:
return undefined;
case ModuleKind.CommonJS:
return "commonjs";
case ModuleKind.System:
return "system";
case ModuleKind.UMD:
return "umd";
default:
return "amd";
}
}
/* @internal */
export function newLineKindToString(kind: NewLineKind): string {
switch (kind) {
case NewLineKind.CarriageReturnLineFeed:
return "CRLF";
default:
return "LF";
}
}
};
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost {
let currentDirectory: string;