How to use longest - 2 common examples

To help you get started, we’ve selected a few longest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pixeloven / pixeloven / packages / pixeloven / cz-simplified-changelog / src / engine.ts View on Github external
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.
github stevenvachon / broken-link-checker / lib / cli.js View on Github external
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`);
};

longest

Get the longest item in an array.

MIT
Latest version published 8 years ago

Package Health Score

68 / 100
Full package analysis

Popular longest functions