Reuse code from convertJsonOptionOfCustomType

This commit is contained in:
Andy Hanson
2016-12-07 08:19:47 -08:00
parent c1ec7eff08
commit efa8c4171b

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 */