Skip to content

Commit 4a130d3

Browse files
committedJun 20, 2017
Require Node.js 4
1 parent d4c3315 commit 4a130d3

8 files changed

+75
-90
lines changed
 

‎.editorconfig

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10-
[{package.json,*.yml}]
10+
[*.yml]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

‎.gitattributes

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

‎.travis.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
sudo: false
21
language: node_js
32
node_js:
4-
- 'iojs'
5-
- '0.12'
6-
- '0.10'
3+
- '8'
4+
- '6'
5+
- '4'

‎index.js

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

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

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

‎license

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
The MIT License (MIT)
1+
MIT License
22

33
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
116

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎package.json

+50-55
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
11
{
2-
"name": "has-ansi",
3-
"version": "2.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-
"maintainers": [
13-
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
14-
"Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)",
15-
"JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
16-
],
17-
"engines": {
18-
"node": ">=0.10.0"
19-
},
20-
"scripts": {
21-
"test": "xo && ava"
22-
},
23-
"files": [
24-
"index.js"
25-
],
26-
"keywords": [
27-
"ansi",
28-
"styles",
29-
"color",
30-
"colour",
31-
"colors",
32-
"terminal",
33-
"console",
34-
"string",
35-
"tty",
36-
"escape",
37-
"shell",
38-
"xterm",
39-
"command-line",
40-
"text",
41-
"regex",
42-
"regexp",
43-
"re",
44-
"match",
45-
"test",
46-
"find",
47-
"pattern",
48-
"has"
49-
],
50-
"dependencies": {
51-
"ansi-regex": "^2.0.0"
52-
},
53-
"devDependencies": {
54-
"ava": "*",
55-
"xo": "*"
56-
}
2+
"name": "has-ansi",
3+
"version": "2.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": "^2.0.0"
47+
},
48+
"devDependencies": {
49+
"ava": "*",
50+
"xo": "*"
51+
}
5752
}

‎readme.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# has-ansi [![Build Status](https://travis-ci.org/chalk/has-ansi.svg?branch=master)](https://travis-ci.org/chalk/has-ansi)
22

3-
> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
3+
> Check if a string has [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
44
55

66
## Install
77

88
```
9-
$ npm install --save has-ansi
9+
$ npm install has-ansi
1010
```
1111

1212

1313
## Usage
1414

1515
```js
16-
var hasAnsi = require('has-ansi');
16+
const hasAnsi = require('has-ansi');
1717

18-
hasAnsi('\u001b[4mcake\u001b[0m');
18+
hasAnsi('\u001B[4mUnicorn\u001B[0m');
1919
//=> true
2020

2121
hasAnsi('cake');
@@ -31,6 +31,11 @@ hasAnsi('cake');
3131
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
3232

3333

34+
## Maintainers
35+
36+
- [Sindre Sorhus](https://github.com/sindresorhus)
37+
- [Josh Junon](https://github.com/qix-)
38+
3439
## License
3540

36-
MIT © [Sindre Sorhus](http://sindresorhus.com)
41+
MIT

‎test.js

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

44
test(t => {
5-
t.true(m('foo\u001b[4mcake\u001b[0m'));
5+
t.true(m('foo\u001B[4mcake\u001B[0m'));
66
t.false(m('cake'));
77
});

0 commit comments

Comments
 (0)
Please sign in to comment.