has-ansi 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.js +6 -3
  2. package/license +4 -16
  3. package/package.json +7 -10
  4. package/readme.md +15 -10
package/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  'use strict';
2
- var ansiRegex = require('ansi-regex');
3
- var re = new RegExp(ansiRegex().source); // remove the `g` flag
4
- module.exports = re.test.bind(re);
2
+ const ansiRegex = require('ansi-regex');
3
+
4
+ // Remove the `g` flag
5
+ const re = new RegExp(ansiRegex().source);
6
+
7
+ module.exports = input => re.test(input);
package/license CHANGED
@@ -1,21 +1,9 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
3
  Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
4
 
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:
11
6
 
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.
14
8
 
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/package.json CHANGED
@@ -1,23 +1,19 @@
1
1
  {
2
2
  "name": "has-ansi",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Check if a string has ANSI escape codes",
5
5
  "license": "MIT",
6
- "repository": "sindresorhus/has-ansi",
6
+ "repository": "chalk/has-ansi",
7
7
  "author": {
8
8
  "name": "Sindre Sorhus",
9
9
  "email": "sindresorhus@gmail.com",
10
10
  "url": "sindresorhus.com"
11
11
  },
12
- "maintainers": [
13
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
14
- "Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)"
15
- ],
16
12
  "engines": {
17
- "node": ">=0.10.0"
13
+ "node": ">=4"
18
14
  },
19
15
  "scripts": {
20
- "test": "node test.js"
16
+ "test": "xo && ava"
21
17
  },
22
18
  "files": [
23
19
  "index.js"
@@ -47,9 +43,10 @@
47
43
  "has"
48
44
  ],
49
45
  "dependencies": {
50
- "ansi-regex": "^2.0.0"
46
+ "ansi-regex": "^3.0.0"
51
47
  },
52
48
  "devDependencies": {
53
- "ava": "0.0.4"
49
+ "ava": "*",
50
+ "xo": "*"
54
51
  }
55
52
  }
package/readme.md CHANGED
@@ -1,21 +1,21 @@
1
- # has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)
1
+ # has-ansi [![Build Status](https://travis-ci.org/chalk/has-ansi.svg?branch=master)](https://travis-ci.org/chalk/has-ansi)
2
2
 
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)
4
4
 
5
5
 
6
6
  ## Install
7
7
 
8
8
  ```
9
- $ npm install --save has-ansi
9
+ $ npm install has-ansi
10
10
  ```
11
11
 
12
12
 
13
13
  ## Usage
14
14
 
15
15
  ```js
16
- var hasAnsi = require('has-ansi');
16
+ const hasAnsi = require('has-ansi');
17
17
 
18
- hasAnsi('\u001b[4mcake\u001b[0m');
18
+ hasAnsi('\u001B[4mUnicorn\u001B[0m');
19
19
  //=> true
20
20
 
21
21
  hasAnsi('cake');
@@ -25,12 +25,17 @@ hasAnsi('cake');
25
25
 
26
26
  ## Related
27
27
 
28
- - [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module
29
- - [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes
30
- - [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes
31
- - [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right
28
+ - [has-ansi-cli](https://github.com/chalk/has-ansi-cli) - CLI for this module
29
+ - [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
30
+ - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
31
+ - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
32
32
 
33
33
 
34
+ ## Maintainers
35
+
36
+ - [Sindre Sorhus](https://github.com/sindresorhus)
37
+ - [Josh Junon](https://github.com/qix-)
38
+
34
39
  ## License
35
40
 
36
- MIT © [Sindre Sorhus](http://sindresorhus.com)
41
+ MIT