Skip to content

Commit

Permalink
feat: expose array with processed dependency data
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidobo committed Jan 25, 2023
1 parent e7649cd commit 557cfe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/charts/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ module.exports = (dependencies) => {
}),
);

return jsonToCsv(processedDependencies);
return {
csvData: jsonToCsv(processedDependencies),
jsonData: processedDependencies,
};
};
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ const getReport = async ({

onProgress({type: 'start', stage: 'csv'});
let csvData;
let jsonData;
try {
csvData = csv(dGraph.all);
({csvData, jsonData} = csv(dGraph.all));
} catch (error) {
errors.push(error);
}
Expand All @@ -86,6 +87,7 @@ const getReport = async ({
rootVulnerabilities,
svgs,
csv: csvData,
allDependencies: jsonData,
name: packageGraph.name,
version: packageGraph.version,
errors,
Expand Down

0 comments on commit 557cfe4

Please sign in to comment.