Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const buildIssueBody = (bodyOutputs = [], config) => {
const bodyStrings = []
const { output = {} } = config || {}
const beforeMD = output['before.md'] || ''
const afterMD = output['after.md'] || '\n\n'
if (beforeMD) bodyStrings.push(beforeMD)
bodyOutputs.forEach(({ label, value }) => {
if (value) {
bodyStrings.push(`${label || ''}${value}`)
} else if (label && !value && !output.hideEmpty) {
bodyStrings.push(`${label}`)
}
})
if (afterMD) bodyStrings.push(afterMD)
return bodyStrings.join('\n\n')
}