Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Commit

Permalink
main - Remove destructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Lemmon committed Dec 4, 2020
1 parent 529ddd7 commit c26e889
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// TODO: can't this be done within the GraphQL query itself?
function formatVulnerabilityAlerts(data) {
console.log('data', data)
const {
repository: {
vulnerabilityAlerts: { edges },
},
} = data
// const {
// repository: {
// vulnerabilityAlerts: { edges },
// },
// } = data

return edges.map(edge => {
const advisory = edge.node.securityAdvisory
const { vulnerabilities, ...rest } = advisory
const firstVulnerabilityNode = vulnerabilities.edges[0].node
const vulnerableVersionRange = firstVulnerabilityNode.vulnerableVersionRange
// return edges.map(edge => {
// const advisory = edge.node.securityAdvisory
// const { vulnerabilities, ...rest } = advisory
// const firstVulnerabilityNode = vulnerabilities.edges[0].node
// const vulnerableVersionRange = firstVulnerabilityNode.vulnerableVersionRange

return {
...rest,
versionRange: vulnerableVersionRange,
}
})
// return {
// ...rest,
// versionRange: vulnerableVersionRange,
// }
// })
}

module.exports = {
Expand Down

0 comments on commit c26e889

Please sign in to comment.