summaryrefslogtreecommitdiff
path: root/ext/console/02_console.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r--ext/console/02_console.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index 0bafd532d..a8b335b94 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -47,6 +47,7 @@ const {
StringPrototypeIncludes,
StringPrototypeStartsWith,
TypeError,
+ NumberIsInteger,
NumberParseInt,
RegExp,
RegExpPrototype,
@@ -232,11 +233,6 @@ function renderRow(row, columnWidths, columnRightAlign) {
return out;
}
-function canRightAlign(value) {
- const isNumber = !isNaN(value);
- return isNumber;
-}
-
function cliTable(head, columns) {
const rows = [];
const columnWidths = ArrayPrototypeMap(head, (h) => getStringWidth(h));
@@ -257,7 +253,7 @@ function cliTable(head, columns) {
const width = columnWidths[i] || 0;
const counted = getStringWidth(value);
columnWidths[i] = MathMax(width, counted);
- columnRightAlign[i] &= canRightAlign(value);
+ columnRightAlign[i] &= NumberIsInteger(+value);
}
}