mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Use native generators/iterables, remove helper cruft (#51921)
This commit is contained in:
@@ -51,7 +51,6 @@ import {
|
||||
getCompilerOptionsDiffValue,
|
||||
getConfigFileParsingDiagnostics,
|
||||
getDiagnosticText,
|
||||
getEntries,
|
||||
getErrorSummaryText,
|
||||
getLineStarts,
|
||||
getNormalizedAbsolutePath,
|
||||
@@ -400,7 +399,7 @@ function generateOptionOutput(sys: System, option: CommandLineOption, rightAlign
|
||||
option.type.forEach((value, name) => {
|
||||
(inverted[value] ||= []).push(name);
|
||||
});
|
||||
return getEntries(inverted)
|
||||
return Object.entries(inverted)
|
||||
.map(([, synonyms]) => synonyms.join("/"))
|
||||
.join(", ");
|
||||
}
|
||||
@@ -1159,8 +1158,8 @@ function reportStatistics(sys: System, programOrConfig: Program | ParsedCommandL
|
||||
|
||||
const lineCounts = countLines(program);
|
||||
if (compilerOptions.extendedDiagnostics) {
|
||||
for (const key of arrayFrom(lineCounts.keys())) {
|
||||
reportCountStatistic("Lines of " + key, lineCounts.get(key)!);
|
||||
for (const [key, value] of lineCounts.entries()) {
|
||||
reportCountStatistic("Lines of " + key, value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user