Skip to content

Commit 0084071

Browse files
vigneshshanmugamsokra
authored andcommitted
fix value on the asset stats
1 parent 7736ebe commit 0084071

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/Stats.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ Stats.jsonToString = function jsonToString(obj, useColors) {
398398
buf.push("\n");
399399
}
400400

401+
function getValue(arr, row, col) {
402+
return typeof arr[row][col] === "object" ?
403+
arr[row][col].value : arr[row][col]
404+
}
405+
401406
function table(array, align, splitter) {
402407
var row;
403408
var rows = array.length;
@@ -409,7 +414,7 @@ Stats.jsonToString = function jsonToString(obj, useColors) {
409414
colSizes[col] = 3;
410415
for(row = 0; row < rows; row++) {
411416
for(col = 0; col < cols; col++) {
412-
value = array[row][col].value + "";
417+
value = getValue(array, row, col) + "";
413418
if(value.length > colSizes[col]) {
414419
colSizes[col] = value.length;
415420
}
@@ -418,7 +423,7 @@ Stats.jsonToString = function jsonToString(obj, useColors) {
418423
for(row = 0; row < rows; row++) {
419424
for(col = 0; col < cols; col++) {
420425
var format = row === 0 ? colors.bold : array[row][col].color;
421-
value = array[row][col].value + "";
426+
value = getValue(array, row, col) + "";
422427
var l = value.length;
423428
if(align[col] === "l")
424429
format(value);

0 commit comments

Comments
 (0)