@@ -181,45 +181,39 @@ export function printOccurrences(bomJson) {
181
181
if ( ! bomJson || ! bomJson . components ) {
182
182
return ;
183
183
}
184
-
185
- const data = [ [ "Group" , "Name" , "Version" , "Occurrences" ] ] ;
186
-
184
+ const data = [ "Group" , "Name" , "Version" , "Occurrences" ] ;
187
185
const config = {
188
186
columnDefault : {
189
- width : 50 ,
187
+ width : 30 ,
190
188
} ,
191
189
columnCount : 4 ,
192
- columns : [ { width : 20 } , { width : 40 } , { width : 50 } , { width : 80 } ] ,
190
+ columns : [
191
+ { width : 30 } ,
192
+ { width : 30 } ,
193
+ { width : 25 , alignment : "right" } ,
194
+ { width : 80 } ,
195
+ ] ,
193
196
} ;
194
-
195
197
const stream = createStream ( config ) ; // Create stream with the config
196
-
197
- const header = "Component Evidence\nGenerated with ♥ by cdxgen" ;
198
+ const header = "Component Evidence\nGenerated with \u2665 by cdxgen" ;
198
199
console . log ( header ) ;
199
-
200
+ stream . write ( data ) ;
200
201
// Stream the components
201
202
for ( const comp of bomJson . components ) {
202
- try {
203
- if ( comp . evidence ?. occurrences ) {
204
- const row = [
205
- comp . group || "" ,
206
- comp . name ,
207
- comp . version || "" ,
208
- comp . evidence . occurrences
209
- . map ( ( l ) => l . location )
210
- . sort ( locationComparator )
211
- . join ( "\n" ) ,
212
- ] ;
213
- stream . write ( row ) ;
214
- }
215
- } catch ( error ) {
216
- console . error ( "Error processing component:" , error ) ;
203
+ if ( comp . evidence ?. occurrences ) {
204
+ const row = [
205
+ comp . group || "" ,
206
+ comp . name ,
207
+ comp . version || "" ,
208
+ comp . evidence . occurrences
209
+ . map ( ( l ) => l . location )
210
+ . sort ( locationComparator )
211
+ . join ( "\n" ) ,
212
+ ] ;
213
+ stream . write ( row ) ;
217
214
}
218
215
}
219
-
220
- stream . on ( "error" , ( error ) => {
221
- console . error ( "Stream error:" , error ) ;
222
- } ) ;
216
+ console . log ( ) ;
223
217
}
224
218
225
219
export function printCallStack ( bomJson ) {
0 commit comments