Skip to content

Commit 5eb6cf7

Browse files
authored
Merge pull request #103 from boneskull/issue/102
Fix Jest configuration
2 parents d9852e9 + 150d2d7 commit 5eb6cf7

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"object-assign": "^4.1.0",
17-
"stringz": "^1.0.0"
17+
"string-width": "^3.0.0"
1818
},
1919
"devDependencies": {
2020
"ansi-256-colors": "^1.1.0",
@@ -76,7 +76,7 @@
7676
{
7777
"displayName": "test",
7878
"testMatch": [
79-
"**/test/**/*-test(s)?.js"
79+
"<rootDir>/test/*.js"
8080
]
8181
},
8282
{

src/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const objectAssign = require('object-assign');
2-
const stringz = require('stringz');
2+
const stringWidth = require('string-width');
33

44
function codeRegex(capture) {
55
return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
@@ -10,7 +10,7 @@ function strlen(str) {
1010
let stripped = ('' + str).replace(code, '');
1111
let split = stripped.split('\n');
1212
return split.reduce(function(memo, s) {
13-
return stringz.length(s) > memo ? stringz.length(s) : memo;
13+
return stringWidth(s) > memo ? stringWidth(s) : memo;
1414
}, 0);
1515
}
1616

yarn.lock

+15-13
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,11 @@ ecc-jsbn@~0.1.1:
12061206
dependencies:
12071207
jsbn "~0.1.0"
12081208

1209+
emoji-regex@^7.0.1:
1210+
version "7.0.1"
1211+
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.1.tgz#5a132b28ebf84a289ba692862f7d4206ebcd32d0"
1212+
integrity sha512-cjx7oFbFIyZMpmWaEBnKeJXWAVzjXwK6yHiz/5X73A2Ww4pnabw+4ZaA/MxLroIQQrB3dL6XzEz8P3aZsSdj8Q==
1213+
12091214
encoding@^0.1.11:
12101215
version "0.1.12"
12111216
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
@@ -4299,6 +4304,15 @@ string-width@^1.0.1:
42994304
is-fullwidth-code-point "^2.0.0"
43004305
strip-ansi "^4.0.0"
43014306

4307+
string-width@^3.0.0:
4308+
version "3.1.0"
4309+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
4310+
integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
4311+
dependencies:
4312+
emoji-regex "^7.0.1"
4313+
is-fullwidth-code-point "^2.0.0"
4314+
strip-ansi "^5.1.0"
4315+
43024316
string.prototype.padend@^3.0.0:
43034317
version "3.0.0"
43044318
resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0"
@@ -4315,13 +4329,6 @@ string_decoder@~1.1.1:
43154329
dependencies:
43164330
safe-buffer "~5.1.0"
43174331

4318-
stringz@^1.0.0:
4319-
version "1.0.0"
4320-
resolved "https://registry.yarnpkg.com/stringz/-/stringz-1.0.0.tgz#d2acba994e4ce3c725ee15c86fff4281280d2025"
4321-
integrity sha512-oaqFaIAmw1MJmdPNiBqocHHrC0VzJTL3CI1z5uXm3NQSE3AyDU152ZPTSJSOKk+9z1Cm3LZzgLFjCTb8SXZvag==
4322-
dependencies:
4323-
unicode-astral-regex "^1.0.1"
4324-
43254332
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
43264333
version "3.0.1"
43274334
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
@@ -4336,7 +4343,7 @@ strip-ansi@^4.0.0:
43364343
dependencies:
43374344
ansi-regex "^3.0.0"
43384345

4339-
strip-ansi@^5.0.0:
4346+
strip-ansi@^5.0.0, strip-ansi@^5.1.0:
43404347
version "5.1.0"
43414348
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.1.0.tgz#55aaa54e33b4c0649a7338a43437b1887d153ec4"
43424349
integrity sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==
@@ -4553,11 +4560,6 @@ uglify-js@^3.1.4:
45534560
commander "~2.17.1"
45544561
source-map "~0.6.1"
45554562

4556-
unicode-astral-regex@^1.0.1:
4557-
version "1.0.1"
4558-
resolved "https://registry.yarnpkg.com/unicode-astral-regex/-/unicode-astral-regex-1.0.1.tgz#2cab8529480646f9614ddbc7b62158ad05123feb"
4559-
integrity sha512-UP6cmDeiWi8bMDmkyXLRsDuVPTvPjh8Wsz+pHu1VkGgTBl4pUceYAdHXY0cdc6Q3+Z2q7QMzi/0E7L/S/yOvFw==
4560-
45614563
union-value@^1.0.0:
45624564
version "1.0.0"
45634565
resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"

0 commit comments

Comments
 (0)