Clean up helpers which are always present in ES2020 (#55515)

This commit is contained in:
Jake Bailey
2023-08-28 12:26:22 -07:00
committed by GitHub
parent 5ce34cafad
commit b5b6048bb3
13 changed files with 37 additions and 199 deletions

View File

@@ -110,7 +110,6 @@ import {
toFileNameLowerCase,
toPath,
tracing,
trimString,
TsConfigOnlyOption,
TsConfigSourceFile,
TypeAcquisition,
@@ -1699,13 +1698,13 @@ function createDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType
}
/** @internal */
export function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]) {
return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
export function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string | undefined, errors: Diagnostic[]) {
return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors);
}
/** @internal */
export function parseListTypeOption(opt: CommandLineOptionOfListType, value = "", errors: Diagnostic[]): string | (string | number)[] | undefined {
value = trimString(value);
value = value.trim();
if (startsWith(value, "-")) {
return undefined;
}