mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
use toLowerCase and remove unused property
This commit is contained in:
parent
509232f477
commit
d3d4a00691
@ -504,17 +504,18 @@ namespace ts {
|
||||
else {
|
||||
let compilerOptions = extend(options, defaultInitCompilerOptions);
|
||||
let configs = {
|
||||
compilerOptions: serializeCompilerOptions(compilerOptions, currentDirectory),
|
||||
compilerOptions: serializeCompilerOptions(compilerOptions),
|
||||
files: fileNames,
|
||||
exclude: ["node_modules"]
|
||||
exclude: ["node_modules"],
|
||||
};
|
||||
|
||||
sys.writeFile(file, JSON.stringify(configs, undefined, 4));
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Successfully_created_a_tsconfig_json_file));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
function serializeCompilerOptions(options: CompilerOptions, currentDirectory: string): Map<string|number|boolean> {
|
||||
function serializeCompilerOptions(options: CompilerOptions): Map<string|number|boolean> {
|
||||
let result: Map<string|number|boolean> = {};
|
||||
let optionsNameMap = getOptionNameMap().optionNameMap;
|
||||
|
||||
@ -529,7 +530,7 @@ namespace ts {
|
||||
case "project":
|
||||
break;
|
||||
default:
|
||||
let optionDefinition = optionsNameMap[name];
|
||||
let optionDefinition = optionsNameMap[name.toLowerCase()];
|
||||
if (optionDefinition) {
|
||||
if (typeof optionDefinition.type === "string") {
|
||||
// string, number or boolean
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user