REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 1.74 KB
Close
//lib/node_modules/npm/node_modules/cli-columns/test.js
Text
Base64
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); });
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
color.js
384 B
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.59 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.10 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.75 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
2.61 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test.js
1.74 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).