File tree 4 files changed +18
-5
lines changed
4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
3
+ */
4
+ export default function stripAnsi ( str : string ) : string ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
const ansiRegex = require ( 'ansi-regex' ) ;
3
3
4
- module . exports = input => typeof input === 'string' ? input . replace ( ansiRegex ( ) , '' ) : input ;
4
+ const stripAnsi = input => typeof input === 'string' ? input . replace ( ansiRegex ( ) , '' ) : input ;
5
+
6
+ module . exports = stripAnsi ;
7
+ module . exports . default = stripAnsi ;
Original file line number Diff line number Diff line change
1
+ import { expectType } from 'tsd-check' ;
2
+ import stripAnsi from '.' ;
3
+
4
+ expectType < string > ( stripAnsi ( '\u001b[4mcake\u001b[0m' ) ) ;
Original file line number Diff line number Diff line change 13
13
"node" : " >=6"
14
14
},
15
15
"scripts" : {
16
- "test" : " xo && ava"
16
+ "test" : " xo && ava && tsd-check "
17
17
},
18
18
"files" : [
19
- " index.js"
19
+ " index.js" ,
20
+ " index.d.ts"
20
21
],
21
22
"keywords" : [
22
23
" strip" ,
46
47
"ansi-regex" : " ^4.1.0"
47
48
},
48
49
"devDependencies" : {
49
- "ava" : " ^0.25.0" ,
50
- "xo" : " ^0.23.0"
50
+ "ava" : " ^1.3.1" ,
51
+ "tsd-check" : " ^0.5.0" ,
52
+ "xo" : " ^0.24.0"
51
53
}
52
54
}
You can’t perform that action at this time.
0 commit comments