@@ -28,7 +28,7 @@ async def js_ts_get_used_artifacts(
2828 if not search (r"import\s|require\(" , line ):
2929 for (artifact , _type , source ) in used_artifacts :
3030 if artifact in line :
31- used_artifacts [(artifact , _type , source )].append (current_line )
31+ used_artifacts [(artifact , _type , source )].append (str ( current_line ) )
3232 current_line += 1
3333 used_artifacts = {
3434 (artifact , _type , source ): lines
@@ -38,7 +38,7 @@ async def js_ts_get_used_artifacts(
3838 result = []
3939 groups_by_name_type = {}
4040 for (artifact_name , artifact_type , source ), used_in_lines in used_artifacts .items ():
41- groups_by_name_type .setdefault ((artifact_name , artifact_type , used_in_lines ), []).append (source )
41+ groups_by_name_type .setdefault ((artifact_name , artifact_type , "," . join ( used_in_lines ) ), []).append (source )
4242 for (artifact_name , artifact_type , used_in_lines ), sources in groups_by_name_type .items ():
4343 result .append ({
4444 "artifact_name" : artifact_name ,
@@ -54,8 +54,8 @@ async def get_child_artifacts(
5454 code : str ,
5555 cve_description : str ,
5656 affected_artefacts : dict [str , list [str ]]
57- ) -> dict [tuple [str , str , str ], list [int ]]:
58- used_artifacts : dict [tuple [str , str , str ], list [int ]] = {}
57+ ) -> dict [tuple [str , str , str ], list [str ]]:
58+ used_artifacts : dict [tuple [str , str , str ], list [str ]] = {}
5959 patterns = [
6060 (rf"{ parent } \.[^\(\)\s:;]+" , "split_by_dot" ),
6161 (rf"import\s+{{[^}}]+}}\s+from\s+['\"]{ parent } ['\"]" , "split_by_braces" ),
0 commit comments