Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const updatedModules = [];
let isUpdateFinished = false;
while (modulesToUpdate.length && !isUpdateFinished) {
const outdatedModule = modulesToUpdate.shift();
const {name, from, to} = outdatedModule;
let {changelogUrl, homepage} = outdatedModule;
// Adds new line
console.log('');
const answer = await askUser({
type: 'list',
message: `${changelogUrl === undefined ? 'U' : 'So, u'}pdate "${name}" in package.json ` +
`from ${from} to ${colorizeDiff(from, to)}?`,
choices: _.compact([
{name: 'Yes', value: true},
{name: 'No', value: false},
// Don't show this option if we couldn't find module's changelog url
(changelogUrl !== null) &&
{name: 'Show changelog', value: 'changelog'},
// Show this if we haven't found changelog
(changelogUrl === null && homepage !== null) &&
{name: 'Open homepage', value: 'homepage'},
{name: 'Ignore', value: 'ignore'},
{name: 'Finish update process', value: 'finish'}
]),
// Automatically setting cursor to "Open homepage" after we haven't found changelog
default: (changelogUrl === null && homepage === undefined) ? 2 : 0
});