Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createUpdateMessage(updateInfo, version) {
let updateMessage;
try {
updateMessage =
updateInfo.success && semver.lt(version, updateInfo.data.latest.version)
? dedent`
${colors.orange(
`A new version (${chalk.bold(updateInfo.data.latest.version)}) is available!`
)}
${chalk.gray('Read full changelog here:')} ${chalk.gray.underline('https://git.io/fhFYe')}
`
: '';
} catch (e) {
updateMessage = '';
}
return updateMessage;
}