File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function printMarkdownTable(data: any[]) {
2828 const keys = Object . keys ( data [ 0 ] )
2929 const alignments = keys . map ( ( key ) => ( typeof data [ 0 ] [ key ] === 'number' ? '---:' : ':---' ) )
3030 console . log ( `| ${ keys . join ( ' | ' ) } |\n| ${ alignments . join ( ' | ' ) } |` )
31- console . log ( data . map ( ( row ) => `| ${ keys . map ( ( key ) => row [ key ] ) . join ( ' | ' ) } |` ) . join ( '\n' ) )
31+ console . log ( data . map ( ( row ) => `| ${ keys . map ( ( key ) => ( key === 'diff' ? formatDiff ( row [ key ] ) : row [ key ] ) ) . join ( ' | ' ) } |` ) . join ( '\n' ) )
3232}
3333
3434const formatDiff = ( count : number ) => ( count > 0 ? `+${ count } ` : count . toString ( ) )
@@ -67,7 +67,7 @@ if (import.meta.main) {
6767 diff . sort ( ( a , b ) => b . diff - a . diff )
6868
6969 console . log ( '## Changes:' )
70- printMarkdownTable ( diff . map ( ( row ) => ( { ... row , diff : formatDiff ( row . diff ) } ) ) )
70+ printMarkdownTable ( diff )
7171
7272 const totalDiff = diff . reduce ( ( sum , file ) => sum + file . diff , 0 )
7373 const total = prStats . reduce ( ( sum , file ) => sum + file . lines , 0 )
You can’t perform that action at this time.
0 commit comments