File tree 4 files changed +7
-13
lines changed
ScannnerResultPostProcessor/rules
4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " scanoss" ,
3
- "version" : " 0.15.4 " ,
3
+ "version" : " 0.15.5 " ,
4
4
"description" : " The SCANOSS JS package provides a simple, easy to consume module for interacting with SCANOSS APIs/Engine." ,
5
5
"main" : " build/main/index.js" ,
6
6
"typings" : " build/main/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -60,12 +60,6 @@ export function validateSettingsFile(settings: Settings) {
60
60
if ( ! Array . isArray ( bom . remove ) ) {
61
61
throw new Error ( "[ SETTINGS FILE ]: 'remove' must be an array" ) ;
62
62
}
63
-
64
- bom . remove . forEach ( ( item , index ) => {
65
- if ( ! item . purl ) {
66
- throw new Error ( `[ SETTINGS FILE ]: Missing required 'purl' in remove item.\n ${ JSON . stringify ( item , null , 2 ) } ` ) ;
67
- }
68
- } ) ;
69
63
}
70
64
71
65
if ( bom . replace ) {
@@ -74,9 +68,6 @@ export function validateSettingsFile(settings: Settings) {
74
68
}
75
69
76
70
bom . replace . forEach ( ( item , index ) => {
77
- if ( ! item . purl ) {
78
- throw new Error ( `[ SETTINGS FILE ]: Missing required 'purl' in replace item.\n ${ JSON . stringify ( item , null , 2 ) } ` ) ;
79
- }
80
71
if ( ! item . replace_with ) {
81
72
throw new Error ( `[ SETTINGS FILE ]: Missing required 'replace_with' in replace item.\n ${ JSON . stringify ( item , null , 2 ) } ` ) ;
82
73
}
Original file line number Diff line number Diff line change @@ -158,10 +158,10 @@ export class Scanner extends EventEmitter {
158
158
this . init ( ) ;
159
159
this . createOutputFiles ( ) ;
160
160
this . scannerInput = scannerInput ;
161
- this . settings = scannerInput [ 0 ] . settings ? { ...scannerInput [ 0 ] . settings } : null ;
161
+ this . settings = scannerInput [ 0 ] ? .settings ? { ...scannerInput [ 0 ] . settings } : null ;
162
162
163
163
164
- if ( scannerInput [ 0 ] . settings ) {
164
+ if ( scannerInput [ 0 ] ? .settings ) {
165
165
validateSettingsFile ( scannerInput [ 0 ] . settings ) ;
166
166
const include = scannerInput [ 0 ] . settings . bom . include . map ( ( i ) => i . purl ) ;
167
167
const replace = scannerInput [ 0 ] . settings . bom . replace . map ( ( r ) => r . replace_with ) ;
@@ -311,7 +311,6 @@ export class Scanner extends EventEmitter {
311
311
this . dispatcher . on (
312
312
ScannerEvents . DISPATCHER_NEW_DATA ,
313
313
async ( response : DispatcherResponse ) => {
314
- console . log ( "ScannerEvents.DISPATCHER_NEW_DATA" )
315
314
this . processedFiles += response . getNumberOfFilesScanned ( ) ;
316
315
this . reportLog (
317
316
`[ SCANNER ]: Received results of ${ response . getNumberOfFilesScanned ( ) } files`
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ export abstract class Rule {
35
35
return this . byPurl ( results , bomItem ) ;
36
36
}
37
37
38
+ if ( bomItem . path ) {
39
+ return this . byPath ( resultPath , bomItem ) ;
40
+ }
41
+
38
42
return false ;
39
43
}
40
44
You can’t perform that action at this time.
0 commit comments