Remove stableSort, rename sort to toSorted (#55728)

This commit is contained in:
Jake Bailey
2024-07-23 18:17:07 -07:00
committed by GitHub
parent ab7b624558
commit 3f6f3164d6
16 changed files with 41 additions and 54 deletions

View File

@@ -71,7 +71,6 @@ import {
ReportEmitErrorSummary,
SolutionBuilder,
SolutionBuilderHostBase,
sort,
SourceFile,
startsWith,
startTracing,
@@ -80,6 +79,7 @@ import {
sys,
System,
toPath,
toSorted,
tracing,
validateLocaleAndSetLanguage,
version,
@@ -170,7 +170,7 @@ function shouldBePretty(sys: System, options: CompilerOptions | BuildOptions) {
function getOptionsForHelp(commandLine: ParsedCommandLine) {
// Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
return !!commandLine.options.all ?
sort(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) :
toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) :
filter(optionDeclarations.slice(), v => !!v.showInSimplifiedHelpView);
}