Skip to content

Commit 027e8ae

Browse files
committed
Require Node.js 8
1 parent a09395c commit 027e8ae

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ language: node_js
55
node_js:
66
- '10'
77
- '8'
8-
- '6'

index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const main = {
6262
sevenEighths: '⅞'
6363
};
6464

65-
const win = {
65+
const windows = {
6666
tick: '√',
6767
cross: '×',
6868
star: '*',
@@ -126,20 +126,19 @@ if (platform === 'linux') {
126126
main.questionMarkPrefix = '?';
127127
}
128128

129-
const figures = platform === 'win32' ? win : main;
129+
const figures = platform === 'win32' ? windows : main;
130130

131131
const fn = string => {
132132
if (figures === main) {
133133
return string;
134134
}
135135

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]) {
139138
continue;
140139
}
141140

142-
string = string.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]);
141+
string = string.replace(new RegExp(escapeStringRegexp(value), 'g'), figures[key]);
143142
}
144143

145144
return string;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "sindresorhus.com"
1111
},
1212
"engines": {
13-
"node": ">=6"
13+
"node": ">=8"
1414
},
1515
"scripts": {
1616
"test": "xo && ava && tsd",
@@ -26,7 +26,6 @@
2626
"cmd",
2727
"command-line",
2828
"characters",
29-
"char",
3029
"symbol",
3130
"symbols",
3231
"figure",

0 commit comments

Comments
 (0)