File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments