Skip to content

Replace hardcoded URL to advisory with a URL from audit response#110

Closed
melkikh wants to merge 1 commit into
npm:release-nextfrom
melkikh:release-next
Closed

Replace hardcoded URL to advisory with a URL from audit response#110
melkikh wants to merge 1 commit into
npm:release-nextfrom
melkikh:release-next

Conversation

@melkikh

@melkikh melkikh commented Dec 6, 2018

Copy link
Copy Markdown

By this PR, we can see a correct advisory URL in the "More info" field.

@melkikh melkikh requested a review from a team as a code owner December 6, 2018 08:31
{'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
{'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
{'More info': `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical, but shorter and avoids repetition:

Suggested change
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`}

{'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
{'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
{'More info': `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`}

l.severity = advisory.title
l.package = advisory.module_name
l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`

l.severity = advisory.title
l.package = advisory.module_name
l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`

@zkat

zkat commented Dec 6, 2018

Copy link
Copy Markdown
Contributor

Please PR this against npm-audit-report, and include the changes suggested by @ljharb.

@zkat zkat closed this Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants