提交 8d834971 编写于 作者: E Erich Gamma

Show only top ten file types

上级 52449b0f
......@@ -72,15 +72,11 @@ function formatWorkspaceStats(workspaceStats: WorkspaceStats): string {
// File Types
let line = '| File types:';
let hasFileTypes = false;
workspaceStats.fileTypes.forEach((item) => {
if (item.value > 20) {
hasFileTypes = true;
appendAndWrap(item.name, item.value);
}
});
if (!hasFileTypes) {
line = `${line} <not enough data>`;
const maxShown = 10;
let max = workspaceStats.fileTypes.length > maxShown ? maxShown : workspaceStats.fileTypes.length;
for (let i = 0; i < max; i++) {
const item = workspaceStats.fileTypes[i];
appendAndWrap(item.name, item.count);
}
output.push(line);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册