File tree 7 files changed +61
-61
lines changed
7 files changed +61
-61
lines changed Original file line number Diff line number Diff line change 1
- * text =auto
2
- * .js text eol =lf
1
+ * text =auto eol =lf
Original file line number Diff line number Diff line change 1
1
node_modules
2
+ yarn.lock
Original file line number Diff line number Diff line change
1
+ package-lock = false
Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
+ - ' 12'
4
+ - ' 10'
3
5
- ' 8'
4
- - ' 6'
5
- - ' 4'
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
const ansiRegex = require ( 'ansi-regex' ) ;
3
3
4
- // Remove the `g` flag
5
- const re = new RegExp ( ansiRegex ( ) . source ) ;
4
+ // Removes the `g` flag
5
+ const regex = new RegExp ( ansiRegex ( ) . source ) ;
6
6
7
- module . exports = input => re . test ( input ) ;
7
+ module . exports = string => regex . test ( string ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " has-ansi" ,
3
- "version" : " 3.0.0" ,
4
- "description" : " Check if a string has ANSI escape codes" ,
5
- "license" : " MIT" ,
6
- "repository" : " chalk/has-ansi" ,
7
- "author" : {
8
- "name" : " Sindre Sorhus" ,
9
- "email" : " sindresorhus@gmail.com" ,
10
- "url" : " sindresorhus.com"
11
- },
12
- "engines" : {
13
- "node" : " >=4"
14
- },
15
- "scripts" : {
16
- "test" : " xo && ava"
17
- },
18
- "files" : [
19
- " index.js"
20
- ],
21
- "keywords" : [
22
- " ansi" ,
23
- " styles" ,
24
- " color" ,
25
- " colour" ,
26
- " colors" ,
27
- " terminal" ,
28
- " console" ,
29
- " string" ,
30
- " tty" ,
31
- " escape" ,
32
- " shell" ,
33
- " xterm" ,
34
- " command-line" ,
35
- " text" ,
36
- " regex" ,
37
- " regexp" ,
38
- " re" ,
39
- " match" ,
40
- " test" ,
41
- " find" ,
42
- " pattern" ,
43
- " has"
44
- ],
45
- "dependencies" : {
46
- "ansi-regex" : " ^3.0.0"
47
- },
48
- "devDependencies" : {
49
- "ava" : " *" ,
50
- "xo" : " *"
51
- }
2
+ "name" : " has-ansi" ,
3
+ "version" : " 3.0.0" ,
4
+ "description" : " Check if a string has ANSI escape codes" ,
5
+ "license" : " MIT" ,
6
+ "repository" : " chalk/has-ansi" ,
7
+ "author" : {
8
+ "name" : " Sindre Sorhus" ,
9
+ "email" : " sindresorhus@gmail.com" ,
10
+ "url" : " sindresorhus.com"
11
+ },
12
+ "engines" : {
13
+ "node" : " >=8"
14
+ },
15
+ "scripts" : {
16
+ "test" : " xo && ava"
17
+ },
18
+ "files" : [
19
+ " index.js"
20
+ ],
21
+ "keywords" : [
22
+ " ansi" ,
23
+ " styles" ,
24
+ " color" ,
25
+ " colour" ,
26
+ " colors" ,
27
+ " terminal" ,
28
+ " console" ,
29
+ " string" ,
30
+ " tty" ,
31
+ " escape" ,
32
+ " shell" ,
33
+ " xterm" ,
34
+ " command-line" ,
35
+ " text" ,
36
+ " regex" ,
37
+ " regexp" ,
38
+ " match" ,
39
+ " test" ,
40
+ " find" ,
41
+ " pattern" ,
42
+ " has"
43
+ ],
44
+ "dependencies" : {
45
+ "ansi-regex" : " ^4.1.0"
46
+ },
47
+ "devDependencies" : {
48
+ "ava" : " ^2.3.0" ,
49
+ "xo" : " ^0.24.0"
50
+ }
52
51
}
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
- import m from '.' ;
2
+ import hasAnsi from '.' ;
3
3
4
- test ( t => {
5
- t . true ( m ( 'foo\u001B[4mcake\u001B[0m' ) ) ;
6
- t . false ( m ( 'cake' ) ) ;
4
+ test ( 'main' , t => {
5
+ t . true ( hasAnsi ( 'foo\u001B[4mcake\u001B[0m' ) ) ;
6
+ t . false ( hasAnsi ( 'cake' ) ) ;
7
7
} ) ;
You can’t perform that action at this time.
0 commit comments