Make compiler options which map to a flag case-insensitive again (#17755)

This commit is contained in:
Wesley Wigham
2017-08-11 19:59:43 -07:00
committed by GitHub
parent 360dc914c3
commit d03d1074ee
5 changed files with 77 additions and 2 deletions

View File

@@ -1116,7 +1116,7 @@ namespace ts {
if (option && typeof option.type !== "string") {
const customOption = <CommandLineOptionOfCustomType>option;
// Validate custom option type
if (!customOption.type.has(text)) {
if (!customOption.type.has(text.toLowerCase())) {
errors.push(
createDiagnosticForInvalidCustomType(
customOption,
@@ -1811,7 +1811,7 @@ namespace ts {
return value;
}
else if (typeof option.type !== "string") {
return option.type.get(value);
return option.type.get(typeof value === "string" ? value.toLowerCase() : value);
}
return normalizeNonListOptionValue(option, basePath, value);
}