strip-ansi 5.0.0 → 6.0.1

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.d.ts +17 -0
  2. package/index.js +1 -1
  3. package/package.json +10 -8
  4. package/readme.md +11 -18
package/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
3
+
4
+ @example
5
+ ```
6
+ import stripAnsi = require('strip-ansi');
7
+
8
+ stripAnsi('\u001B[4mUnicorn\u001B[0m');
9
+ //=> 'Unicorn'
10
+
11
+ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
12
+ //=> 'Click'
13
+ ```
14
+ */
15
+ declare function stripAnsi(string: string): string;
16
+
17
+ export = stripAnsi;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
  const ansiRegex = require('ansi-regex');
3
3
 
4
- module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
4
+ module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "strip-ansi",
3
- "version": "5.0.0",
4
- "description": "Strip ANSI escape codes",
3
+ "version": "6.0.1",
4
+ "description": "Strip ANSI escape codes from a string",
5
5
  "license": "MIT",
6
6
  "repository": "chalk/strip-ansi",
7
7
  "author": {
@@ -10,13 +10,14 @@
10
10
  "url": "sindresorhus.com"
11
11
  },
12
12
  "engines": {
13
- "node": ">=6"
13
+ "node": ">=8"
14
14
  },
15
15
  "scripts": {
16
- "test": "xo && ava"
16
+ "test": "xo && ava && tsd"
17
17
  },
18
18
  "files": [
19
- "index.js"
19
+ "index.js",
20
+ "index.d.ts"
20
21
  ],
21
22
  "keywords": [
22
23
  "strip",
@@ -43,10 +44,11 @@
43
44
  "text"
44
45
  ],
45
46
  "dependencies": {
46
- "ansi-regex": "^4.0.0"
47
+ "ansi-regex": "^5.0.1"
47
48
  },
48
49
  "devDependencies": {
49
- "ava": "^0.25.0",
50
- "xo": "^0.23.0"
50
+ "ava": "^2.4.0",
51
+ "tsd": "^0.10.0",
52
+ "xo": "^0.25.3"
51
53
  }
52
54
  }
package/readme.md CHANGED
@@ -1,20 +1,7 @@
1
1
  # strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
2
2
 
3
- > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
3
+ > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
4
4
 
5
- ---
6
-
7
- <div align="center">
8
- <b>
9
- <a href="https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for 'strip-ansi' with a Tidelift subscription</a>
10
- </b>
11
- <br>
12
- <sub>
13
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
14
- </sub>
15
- </div>
16
-
17
- ---
18
5
 
19
6
  ## Install
20
7
 
@@ -30,9 +17,19 @@ const stripAnsi = require('strip-ansi');
30
17
 
31
18
  stripAnsi('\u001B[4mUnicorn\u001B[0m');
32
19
  //=> 'Unicorn'
20
+
21
+ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
22
+ //=> 'Click'
33
23
  ```
34
24
 
35
25
 
26
+ ## strip-ansi for enterprise
27
+
28
+ Available as part of the Tidelift Subscription.
29
+
30
+ The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
31
+
32
+
36
33
  ## Related
37
34
 
38
35
  - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
@@ -47,7 +44,3 @@ stripAnsi('\u001B[4mUnicorn\u001B[0m');
47
44
  - [Sindre Sorhus](https://github.com/sindresorhus)
48
45
  - [Josh Junon](https://github.com/qix-)
49
46
 
50
-
51
- ## License
52
-
53
- MIT