File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ language: node_js
5
5
node_js :
6
6
- ' 10'
7
7
- ' 8'
8
- - ' 6'
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ const main = {
62
62
sevenEighths : '⅞'
63
63
} ;
64
64
65
- const win = {
65
+ const windows = {
66
66
tick : '√' ,
67
67
cross : '×' ,
68
68
star : '*' ,
@@ -126,20 +126,19 @@ if (platform === 'linux') {
126
126
main . questionMarkPrefix = '?' ;
127
127
}
128
128
129
- const figures = platform === 'win32' ? win : main ;
129
+ const figures = platform === 'win32' ? windows : main ;
130
130
131
131
const fn = string => {
132
132
if ( figures === main ) {
133
133
return string ;
134
134
}
135
135
136
- // TODO: Use `Object.entries` when targeting Node.js 8
137
- for ( const key of Object . keys ( main ) ) {
138
- if ( main [ key ] === figures [ key ] ) {
136
+ for ( const [ key , value ] of Object . entries ( main ) ) {
137
+ if ( value === figures [ key ] ) {
139
138
continue ;
140
139
}
141
140
142
- string = string . replace ( new RegExp ( escapeStringRegexp ( main [ key ] ) , 'g' ) , figures [ key ] ) ;
141
+ string = string . replace ( new RegExp ( escapeStringRegexp ( value ) , 'g' ) , figures [ key ] ) ;
143
142
}
144
143
145
144
return string ;
Original file line number Diff line number Diff line change 10
10
"url" : " sindresorhus.com"
11
11
},
12
12
"engines" : {
13
- "node" : " >=6 "
13
+ "node" : " >=8 "
14
14
},
15
15
"scripts" : {
16
16
"test" : " xo && ava && tsd" ,
26
26
" cmd" ,
27
27
" command-line" ,
28
28
" characters" ,
29
- " char" ,
30
29
" symbol" ,
31
30
" symbols" ,
32
31
" figure" ,
You can’t perform that action at this time.
0 commit comments