wrap-ansi 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -0
- package/package.json +60 -60
package/index.js
CHANGED
@@ -99,6 +99,10 @@ const wrapWord = (rows, word, cols) => {
|
|
99
99
|
const exec = (str, cols, opts) => {
|
100
100
|
const options = opts || {};
|
101
101
|
|
102
|
+
if (str.trim() === '') {
|
103
|
+
return options.trim === false ? str : str.trim();
|
104
|
+
}
|
105
|
+
|
102
106
|
let pre = '';
|
103
107
|
let ret = '';
|
104
108
|
let escapeCode;
|
package/package.json
CHANGED
@@ -1,62 +1,62 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
2
|
+
"name": "wrap-ansi",
|
3
|
+
"version": "3.0.1",
|
4
|
+
"description": "Wordwrap a string with ANSI escape codes",
|
5
|
+
"license": "MIT",
|
6
|
+
"repository": "chalk/wrap-ansi",
|
7
|
+
"author": {
|
8
|
+
"name": "Sindre Sorhus",
|
9
|
+
"email": "sindresorhus@gmail.com",
|
10
|
+
"url": "sindresorhus.com"
|
11
|
+
},
|
12
|
+
"engines": {
|
13
|
+
"node": ">=4"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"test": "xo && nyc ava",
|
17
|
+
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
18
|
+
},
|
19
|
+
"files": [
|
20
|
+
"index.js"
|
21
|
+
],
|
22
|
+
"keywords": [
|
23
|
+
"wrap",
|
24
|
+
"break",
|
25
|
+
"wordwrap",
|
26
|
+
"wordbreak",
|
27
|
+
"linewrap",
|
28
|
+
"ansi",
|
29
|
+
"styles",
|
30
|
+
"color",
|
31
|
+
"colour",
|
32
|
+
"colors",
|
33
|
+
"terminal",
|
34
|
+
"console",
|
35
|
+
"cli",
|
36
|
+
"string",
|
37
|
+
"tty",
|
38
|
+
"escape",
|
39
|
+
"formatting",
|
40
|
+
"rgb",
|
41
|
+
"256",
|
42
|
+
"shell",
|
43
|
+
"xterm",
|
44
|
+
"log",
|
45
|
+
"logging",
|
46
|
+
"command-line",
|
47
|
+
"text"
|
48
|
+
],
|
49
|
+
"dependencies": {
|
50
|
+
"string-width": "^2.1.1",
|
51
|
+
"strip-ansi": "^4.0.0"
|
52
|
+
},
|
53
|
+
"devDependencies": {
|
54
|
+
"ava": "^0.21.0",
|
55
|
+
"chalk": "^2.0.1",
|
56
|
+
"coveralls": "^2.11.4",
|
57
|
+
"has-ansi": "^3.0.0",
|
58
|
+
"nyc": "^11.0.3",
|
59
|
+
"strip-ansi": "^4.0.0",
|
60
|
+
"xo": "^0.18.2"
|
61
|
+
}
|
62
62
|
}
|