File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/ui/purl-alerts-and-scores Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export type PackageScoreAndAlerts = {
22
22
severity : 'critical' | 'high' | 'medium' | 'low' ,
23
23
props : any
24
24
} > ,
25
+ inputPurl : SimPURL ,
25
26
score : {
26
27
license : number ,
27
28
maintenance : number ,
@@ -202,16 +203,9 @@ export class PURLDataCache {
202
203
} )
203
204
for await ( const line of lines ) {
204
205
const scoreAndAlerts = JSON . parse ( line ) as PackageScoreAndAlerts
205
- const type = scoreAndAlerts . type
206
- const name = type === 'pypi' ? scoreAndAlerts . name . replaceAll ( '-' , '_' ) : scoreAndAlerts . name
207
- const namespace = scoreAndAlerts . namespace ? scoreAndAlerts . namespace + '/' : '' ;
208
- const purlWithoutVersion = `pkg:${ type } /${ namespace } ${ name } ${ scoreAndAlerts . qualifiers ? '?' + scoreAndAlerts . qualifiers : '' } ${ scoreAndAlerts . subpath ? '#' + scoreAndAlerts . subpath : '' } ` as SimPURL ;
209
- const purlWithVersion = `pkg:${ type } /${ namespace } ${ name } @${ scoreAndAlerts . version } ${ scoreAndAlerts . qualifiers ? '?' + scoreAndAlerts . qualifiers : '' } ${ scoreAndAlerts . subpath ? '#' + scoreAndAlerts . subpath : '' } ` as SimPURL ;
210
- this . #pkgData. get ( purlWithoutVersion ) ?. update ( scoreAndAlerts ) ;
211
- this . #pkgData. get ( purlWithVersion ) ?. update ( scoreAndAlerts ) ;
212
-
213
- thesePendingUpdates . delete ( purlWithoutVersion )
214
- thesePendingUpdates . delete ( purlWithVersion ) ;
206
+ const inputPurl = scoreAndAlerts . inputPurl
207
+ this . #pkgData. get ( inputPurl ) ?. update ( scoreAndAlerts ) ;
208
+ thesePendingUpdates . delete ( inputPurl )
215
209
}
216
210
bailPendingCacheEntries ( new Error ( 'Not Found' ) )
217
211
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments