Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prompts = prompts.reduce((acc: Prompt[], curr) => {
acc.push(curr);
const rule = snykPolicy.getByVuln(policy, curr.choices![0].value.vuln);
let defaultAnswer = 'None given';
if (rule && rule.type === 'ignore') {
defaultAnswer = rule.reason;
}
const issue =
curr.choices![0].value.vuln &&
curr.choices![0].value.vuln.type === 'license'
? 'issue'
: 'vulnerability';
acc.push({
name: curr.name + '-reason',
message: '[audit] Reason for ignoring ' + issue + '?',
default: defaultAnswer,
when(answers) {
if (!answers[curr.name]) {
return false;