File tree Expand file tree Collapse file tree 3 files changed +27
-21
lines changed
extensions/publisher-cves Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Original file line number Diff line number Diff line change 2020 },
2121 "packages" : {},
2222 "files" : {
23+ "dist/assets/index-B41wDw7-.js" : {
24+ "checksum" : " 6f226fcbe63e27f856c8755bfa5f2cdc"
25+ },
2326 "dist/assets/index-CteWUkOR.css" : {
2427 "checksum" : " e26ddbd6163e429121aaac82256c8f53"
2528 },
26- "dist/assets/index-vlEy0F6m.js" : {
27- "checksum" : " da2cb1d917ec752760f9186b7d02d185"
28- },
2929 "dist/index.html" : {
30- "checksum" : " 0fed520b0a89f55e25e1bbce548aa482 "
30+ "checksum" : " 69a4a2125195046f07166dbdd55fcf8b "
3131 },
3232 "main.py" : {
3333 "checksum" : " f8385dbd8a8cd24204f1eb6209f8bb30"
Original file line number Diff line number Diff line change 22import { useVulnsStore } from " ../stores/vulns" ;
33import { usePackagesStore } from " ../stores/packages" ;
44import { useContentStore } from " ../stores/content" ;
5- import type { Vulnerability } from " ../stores/vulns" ;
5+ import type { Vulnerability , VulnerabilityRange } from " ../stores/vulns" ;
66import type { Package } from " ../stores/packages" ;
77import { computed } from " vue" ;
88
@@ -68,19 +68,21 @@ function getFixedVersion(vuln: Vulnerability): string | null {
6868 return null ;
6969 }
7070
71- // Look through all ranges
71+ let result: string | null = null ;
72+
73+ const getFixedEventValue = (range : VulnerabilityRange ): string | null => {
74+ return range .events .find ((e ) => Boolean (e .fixed ))?.fixed || null ;
75+ };
76+
7277 for (const range of vuln .ranges ) {
73- // Look for events with a "fixed" property
74- if (range .events && Array .isArray (range .events )) {
75- for (const event of range .events ) {
76- if (event .fixed ) {
77- return event .fixed ;
78- }
79- }
78+ if (range .type === " ECOSYSTEM" && range .events ) {
79+ return getFixedEventValue (range );
80+ } else {
81+ result = getFixedEventValue (range );
8082 }
8183 }
8284
83- return null ;
85+ return result ;
8486}
8587
8688// Go back to content list
Original file line number Diff line number Diff line change 11import { defineStore } from "pinia" ;
22import { ref } from "vue" ;
33
4+ export interface VulnerabilityEvent {
5+ introduced ?: string ;
6+ fixed ?: string ;
7+ }
8+
9+ export interface VulnerabilityRange {
10+ type : string ;
11+ events : VulnerabilityEvent [ ] ;
12+ }
13+
414export interface Vulnerability {
515 id : string ;
616 versions : Record < string , any > ;
7- ranges : Array < {
8- type : string ;
9- events : Array < {
10- introduced ?: string ;
11- fixed ?: string ;
12- } > ;
13- } > ;
17+ ranges : VulnerabilityRange [ ] ;
1418 summary : string ;
1519 details : string ;
1620 modified : string ;
You can’t perform that action at this time.
0 commit comments