File tree 4 files changed +12
-13
lines changed
4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1
1
* text =auto
2
+ * .js text eol =lf
Original file line number Diff line number Diff line change @@ -2,5 +2,3 @@ language: node_js
2
2
node_js :
3
3
- ' 6'
4
4
- ' 4'
5
- - ' 0.12'
6
- - ' 0.10'
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
- var stripAnsi = require ( 'strip-ansi' ) ;
3
- var codePointAt = require ( 'code-point-at' ) ;
4
- var isFullwidthCodePoint = require ( 'is-fullwidth-code-point' ) ;
2
+ const stripAnsi = require ( 'strip-ansi' ) ;
3
+ const isFullwidthCodePoint = require ( 'is-fullwidth-code-point' ) ;
5
4
6
- // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
7
- module . exports = function ( str ) {
5
+ module . exports = str => {
8
6
if ( typeof str !== 'string' || str . length === 0 ) {
9
7
return 0 ;
10
8
}
11
9
12
- var width = 0 ;
10
+ let width = 0 ;
13
11
14
12
str = stripAnsi ( str ) ;
15
13
16
- for ( var i = 0 ; i < str . length ; i ++ ) {
17
- var code = codePointAt ( str , i ) ;
14
+ for ( let i = 0 ; i < str . length ; i ++ ) {
15
+ const code = str . codePointAt ( i ) ;
18
16
19
17
// ignore control characters
20
18
if ( code <= 0x1f || ( code >= 0x7f && code <= 0x9f ) ) {
Original file line number Diff line number Diff line change 10
10
"url" : " sindresorhus.com"
11
11
},
12
12
"engines" : {
13
- "node" : " >=0.10.0 "
13
+ "node" : " >=4 "
14
14
},
15
15
"scripts" : {
16
16
"test" : " xo && ava"
45
45
" fixed-width"
46
46
],
47
47
"dependencies" : {
48
- "code-point-at" : " ^1.0.0" ,
49
- "is-fullwidth-code-point" : " ^1.0.0" ,
48
+ "is-fullwidth-code-point" : " ^2.0.0" ,
50
49
"strip-ansi" : " ^3.0.0"
51
50
},
52
51
"devDependencies" : {
53
52
"ava" : " *" ,
54
53
"xo" : " *"
54
+ },
55
+ "xo" : {
56
+ "esnext" : true
55
57
}
56
58
}
You can’t perform that action at this time.
0 commit comments