Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const chooseAsset = async (assets: InstallAsset[]) => {
const choices: { name: string, value: string }[] = [];
assets.forEach((asset) => {
choices.push({ name: asset.name, value: asset.id });
});
const { assetID } = await inquirer.createPromptModule()<{ assetID: string }>({
choices,
type: 'list',
name: 'assetID',
message: 'Multiple potential assets found, please choose one from the list below:'.cyan,
});
return assets.find((asset) => asset.id === assetID)!;
};
await api.install({
chooseAsset,
repo,
interactive: true,
prerelease: program.prerelease,
});
})();