Skip to content

Commit

Permalink
Require Node.js 8
Browse files Browse the repository at this point in the history
Closes #29
  • Loading branch information
sindresorhus committed Nov 9, 2019
1 parent 57878e2 commit 976f459
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
- '6'
6 changes: 4 additions & 2 deletions index.d.ts
Expand Up @@ -3,7 +3,7 @@ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a
@example
```
import stripAnsi from 'strip-ansi';
import stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
Expand All @@ -12,4 +12,6 @@ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
*/
export default function stripAnsi(string: string): string;
declare function stripAnsi(string: string): string;

export = stripAnsi;
5 changes: 1 addition & 4 deletions index.js
@@ -1,7 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');

const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;

module.exports = stripAnsi;
module.exports.default = stripAnsi;
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
4 changes: 2 additions & 2 deletions index.test-d.ts
@@ -1,4 +1,4 @@
import {expectType} from 'tsd-check';
import stripAnsi from '.';
import {expectType} from 'tsd';
import stripAnsi = require('.');

expectType<string>(stripAnsi('\u001B[4mcake\u001B[0m'));
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -10,10 +10,10 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd-check"
"test": "xo && ava && tsd"
},
"files": [
"index.js",
Expand Down Expand Up @@ -44,11 +44,11 @@
"text"
],
"dependencies": {
"ansi-regex": "^4.1.0"
"ansi-regex": "^5.0.0"
},
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.5.0",
"xo": "^0.24.0"
"ava": "^2.4.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}

0 comments on commit 976f459

Please sign in to comment.