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.
Files changed (2) hide show
  1. package/index.js +4 -0
  2. 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
- "name": "wrap-ansi",
3
- "version": "3.0.0",
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
- }
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
  }