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 = {
2222 severity : 'critical' | 'high' | 'medium' | 'low' ,
2323 props : any
2424 } > ,
25+ inputPurl : SimPURL ,
2526 score : {
2627 license : number ,
2728 maintenance : number ,
@@ -202,16 +203,9 @@ export class PURLDataCache {
202203 } )
203204 for await ( const line of lines ) {
204205 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 )
215209 }
216210 bailPendingCacheEntries ( new Error ( 'Not Found' ) )
217211 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments