summaryrefslogtreecommitdiff
path: root/extensions/console
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2021-07-07 21:26:30 +0530
committerGitHub <noreply@github.com>2021-07-07 08:56:30 -0700
commita8dcf9e2617999223f586403c200dea5601bec5f (patch)
tree336eeb2400e29abf3314eccf824a61d521a1f8c5 /extensions/console
parente3a4e9cf11438948ddd86a7ebdac344190acafa8 (diff)
fix(extensions/console): left align table entries (#11295)
Diffstat (limited to 'extensions/console')
-rw-r--r--extensions/console/02_console.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/extensions/console/02_console.js b/extensions/console/02_console.js
index 05f149cfe..6f2ed0c0e 100644
--- a/extensions/console/02_console.js
+++ b/extensions/console/02_console.js
@@ -79,7 +79,6 @@
MapPrototypeForEach,
Error,
ErrorCaptureStackTrace,
- MathCeil,
MathAbs,
MathMax,
MathMin,
@@ -192,12 +191,8 @@
for (let i = 0; i < row.length; i++) {
const cell = row[i];
const len = getStringWidth(cell);
- const needed = (columnWidths[i] - len) / 2;
- // round(needed) + ceil(needed) will always add up to the amount
- // of spaces we need while also left justifying the output.
- out += `${StringPrototypeRepeat(" ", needed)}${cell}${
- StringPrototypeRepeat(" ", MathCeil(needed))
- }`;
+ const needed = columnWidths[i] - len;
+ out += `${cell}${StringPrototypeRepeat(" ", needed)}`;
if (i !== row.length - 1) {
out += tableChars.middle;
}