File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
Expand file tree Collapse file tree 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 11'use strict' ;
22const ansiRegex = require ( 'ansi-regex' ) ;
33
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 1313 "node" : " >=6"
1414 },
1515 "scripts" : {
16- "test" : " xo && ava"
16+ "test" : " xo && ava && tsd-check "
1717 },
1818 "files" : [
19- " index.js"
19+ " index.js" ,
20+ " index.d.ts"
2021 ],
2122 "keywords" : [
2223 " strip" ,
4647 "ansi-regex" : " ^4.1.0"
4748 },
4849 "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"
5153 }
5254}
You can’t perform that action at this time.
0 commit comments