has-ansi 5.0.0 → 6.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 (3) hide show
  1. package/index.d.ts +15 -0
  2. package/package.json +14 -8
  3. package/readme.md +2 -19
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ Check if a string has [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
3
+
4
+ @example
5
+ ```
6
+ import hasAnsi from 'has-ansi';
7
+
8
+ hasAnsi('\u001B[4mUnicorn\u001B[0m');
9
+ //=> true
10
+
11
+ hasAnsi('cake');
12
+ //=> false
13
+ ```
14
+ */
15
+ export default function hasAnsi(string: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "has-ansi",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "Check if a string has ANSI escape codes",
5
5
  "license": "MIT",
6
6
  "repository": "chalk/has-ansi",
@@ -11,15 +11,20 @@
11
11
  "url": "https://sindresorhus.com"
12
12
  },
13
13
  "type": "module",
14
- "exports": "./index.js",
14
+ "exports": {
15
+ "default": "./index.js",
16
+ "types": "./index.d.ts"
17
+ },
18
+ "sideEffects": false,
15
19
  "engines": {
16
- "node": ">=12"
20
+ "node": ">=18"
17
21
  },
18
22
  "scripts": {
19
- "test": "xo && ava"
23
+ "test": "xo && ava && tsd"
20
24
  },
21
25
  "files": [
22
- "index.js"
26
+ "index.js",
27
+ "index.d.ts"
23
28
  ],
24
29
  "keywords": [
25
30
  "ansi",
@@ -45,10 +50,11 @@
45
50
  "has"
46
51
  ],
47
52
  "dependencies": {
48
- "ansi-regex": "^6.0.0"
53
+ "ansi-regex": "^6.0.1"
49
54
  },
50
55
  "devDependencies": {
51
- "ava": "^3.15.0",
52
- "xo": "^0.38.2"
56
+ "ava": "^6.1.3",
57
+ "tsd": "^0.31.1",
58
+ "xo": "^0.58.0"
53
59
  }
54
60
  }
package/readme.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## Install
6
6
 
7
- ```
8
- $ npm install has-ansi
7
+ ```sh
8
+ npm install has-ansi
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -26,20 +26,3 @@ hasAnsi('cake');
26
26
  - [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
27
27
  - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
28
28
  - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
29
-
30
- ## Maintainers
31
-
32
- - [Sindre Sorhus](https://github.com/sindresorhus)
33
- - [Josh Junon](https://github.com/qix-)
34
-
35
- ---
36
-
37
- <div align="center">
38
- <b>
39
- <a href="https://tidelift.com/subscription/pkg/npm-has-ansi?utm_source=npm-has-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
40
- </b>
41
- <br>
42
- <sub>
43
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
44
- </sub>
45
- </div>