Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (options: Options) => {
const types = options.types;
const length: number = longest(Object.keys(types)).length + 1;
const choices = map(types, (type, key) => {
return {
name: rightPad(key + ":", length) + " " + type.description,
value: key,
};
});
return {
// When a user runs `git cz`, prompter will
// be executed. We pass you cz, which currently
// is just an instance of inquirer.js. Using
// this you can ask questions and get answers.
//
// The commit callback should be executed when
// you're ready to send back a commit template
// to git.
let broken;
if (stats.site.totalLinks > 0)
{
broken = stats.site.brokenLinks>0 ? red : green;
}
else
{
broken = gray;
}
output += broken(`\nLinks broken: ${stats.site.brokenLinks}`);
output += gray("\nTime elapsed: ");
output += gray( humanizeDuration(Date.now() - stats.site.startTime, {largest:2, round:true}) );
const separator = gray("=".repeat( longest(stripAnsi(output).split("\n")).length ));
log(`\n${separator}${output}\n${separator}\n`);
};