GRAYBYTE WORDPRESS FILE MANAGER5574

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib/node_modules/npm/node_modules/cli-columns/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib/node_modules/npm/node_modules/cli-columns//test.js
import test from 'ava';
import chalk from 'chalk';
import stripAnsi from 'strip-ansi';
import columns from './index';

test('should print one column list', t => {
	const cols = columns(['foo', ['bar', 'baz'], ['bar', 'qux']], {
		width: 1
	});

	const expected =
		'bar\n' +
		'bar\n' +
		'baz\n' +
		'foo\n' +
		'qux';

	t.is(cols, expected);
});

test('should print three column list', t => {
	const cols = columns(['foo', ['bar', 'baz'], ['bat', 'qux']], {
		width: 16
	});

	const expected =
		'bar  baz  qux  \n' +
		'bat  foo  ';

	t.is(cols, expected);
});

test('should print complex list', t => {
	const cols = columns(
		[
			'foo', 'bar', 'baz',
			chalk.cyan('嶜憃撊') + ' 噾噿嚁',
			'blue' + chalk.bgBlue('berry'),
			chalk.red('apple'), 'pomegranate',
			'durian', chalk.green('star fruit'),
			'apricot', 'banana pineapple'
		],
		{
			width: 80
		}
	);

	const expected =
		'apple             bar               durian            star fruit        \n' +
		'apricot           baz               foo               嶜憃撊 噾噿嚁     \n' +
		'banana pineapple  blueberry         pomegranate       ';

	t.is(stripAnsi(cols), expected);
});

test('should optionally not sort', t => {
	const cols = columns(
		[
			'foo', 'bar', 'baz',
			chalk.cyan('嶜憃撊') + ' 噾噿嚁',
			'blue' + chalk.bgBlue('berry'),
			chalk.red('apple'), 'pomegranate',
			'durian', chalk.green('star fruit'),
			'apricot', 'banana pineapple'
		],
		{
			sort: false,
			width: 80
		}
	);

	const expected =
		'foo               嶜憃撊 噾噿嚁     pomegranate       apricot           \n' +
		'bar               blueberry         durian            banana pineapple  \n' +
		'baz               apple             star fruit        ';

	t.is(stripAnsi(cols), expected);
});

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:36:29
root / root
0755
LICENSE
1.096 KB
March 10 2021 14:36:36
root / root
0644
README.md
2.614 KB
March 10 2021 14:36:36
root / root
0644
color.js
0.375 KB
March 10 2021 14:36:36
root / root
0644
index.js
1.592 KB
March 10 2021 14:36:36
root / root
0644
package.json
1.75 KB
March 10 2021 14:36:36
root / root
0644
test.js
1.735 KB
March 10 2021 14:36:36
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF