Skip to content

Commit 5922c60

Browse files
committedSep 10, 2019
Require Node.js 8
1 parent cc62ac2 commit 5922c60

File tree

7 files changed

+61
-61
lines changed

7 files changed

+61
-61
lines changed
 

‎.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* text=auto
2-
*.js text eol=lf
1+
* text=auto eol=lf

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
yarn.lock

‎.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

‎.travis.yml

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

‎index.js

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

4-
// Remove the `g` flag
5-
const re = new RegExp(ansiRegex().source);
4+
// Removes the `g` flag
5+
const regex = new RegExp(ansiRegex().source);
66

7-
module.exports = input => re.test(input);
7+
module.exports = string => regex.test(string);

‎package.json

+49-50
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
11
{
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+
}
5251
}

‎test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import test from 'ava';
2-
import m from '.';
2+
import hasAnsi from '.';
33

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'));
77
});

0 commit comments

Comments
 (0)
Please sign in to comment.