Skip to content

Commit a33518b

Browse files
committed
fix: improve output formatting
1 parent a28e72e commit a33518b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • implement-shell-tools/wc

‎implement-shell-tools/wc/wc.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ for (const path of paths) {
4343
(total["characterCounter"] ?? 0) + characterCounter;
4444
}
4545

46-
console.log(results.join(" ") + " " + path);
46+
console.log(results.map(value=> String(value).padStart(4)).join(" ") +" "+ path)
4747

4848
} catch (error) {
4949
console.error(error.message);
@@ -52,7 +52,8 @@ for (const path of paths) {
5252
}
5353
if (paths.length > 1) {
5454

55-
console.log(Object.values(total).join(" "),"total")
55+
console.log(Object.values(total).map(value=> String(value).padStart(4)).join(" "),"total")
56+
5657
}
5758
if (hadError) {
5859
process.exitCode = 1;

0 commit comments

Comments
 (0)