Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async createGeneratorChoice(genName: string, genPackagePath: string, packageJson: any): Promise {
let genImageUrl;
try {
genImageUrl = await datauri.promise(path.join(genPackagePath, YeomanUI.YEOMAN_PNG));
} catch (error) {
genImageUrl = defaultImage.default;
}
const genMessage = _.get(packageJson, "description", YeomanUI.defaultMessage);
const genPrettyName = titleize(humanizeString(genName));
const genHomepage = _.get(packageJson, "homepage", '');
return {
name: genName,
prettyName: genPrettyName,
message: genMessage,
homepage: genHomepage,
imageUrl: genImageUrl
};
}