Skip to content

Commit 976f459

Browse files
committed
Require Node.js 8
Closes #29
1 parent 57878e2 commit 976f459

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: node_js
22
node_js:
3+
- '12'
34
- '10'
45
- '8'
5-
- '6'

index.d.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a
33
44
@example
55
```
6-
import stripAnsi from 'strip-ansi';
6+
import stripAnsi = require('strip-ansi');
77
88
stripAnsi('\u001B[4mUnicorn\u001B[0m');
99
//=> 'Unicorn'
@@ -12,4 +12,6 @@ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
1212
//=> 'Click'
1313
```
1414
*/
15-
export default function stripAnsi(string: string): string;
15+
declare function stripAnsi(string: string): string;
16+
17+
export = stripAnsi;

index.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
'use strict';
22
const ansiRegex = require('ansi-regex');
33

4-
const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
5-
6-
module.exports = stripAnsi;
7-
module.exports.default = stripAnsi;
4+
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;

index.test-d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {expectType} from 'tsd-check';
2-
import stripAnsi from '.';
1+
import {expectType} from 'tsd';
2+
import stripAnsi = require('.');
33

44
expectType<string>(stripAnsi('\u001B[4mcake\u001B[0m'));

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"url": "sindresorhus.com"
1111
},
1212
"engines": {
13-
"node": ">=6"
13+
"node": ">=8"
1414
},
1515
"scripts": {
16-
"test": "xo && ava && tsd-check"
16+
"test": "xo && ava && tsd"
1717
},
1818
"files": [
1919
"index.js",
@@ -44,11 +44,11 @@
4444
"text"
4545
],
4646
"dependencies": {
47-
"ansi-regex": "^4.1.0"
47+
"ansi-regex": "^5.0.0"
4848
},
4949
"devDependencies": {
50-
"ava": "^1.3.1",
51-
"tsd-check": "^0.5.0",
52-
"xo": "^0.24.0"
50+
"ava": "^2.4.0",
51+
"tsd": "^0.10.0",
52+
"xo": "^0.25.3"
5353
}
5454
}

0 commit comments

Comments
 (0)