Merge pull request #12708 from Microsoft/convert_json_option

Reuse code from convertJsonOptionOfCustomType
This commit is contained in:
Andy
2016-12-07 08:58:25 -08:00
committed by GitHub

View File

@@ -549,14 +549,7 @@ namespace ts {
/* @internal */
export function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]) {
const key = trimString((value || "")).toLowerCase();
const map = opt.type;
if (key in map) {
return map[key];
}
else {
errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
}
return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
}
/* @internal */