summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/string-width/node_modules
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/string-width/node_modules')
-rw-r--r--deps/npm/node_modules/string-width/node_modules/ansi-regex/index.d.ts37
-rw-r--r--deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js8
-rw-r--r--deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json104
-rw-r--r--deps/npm/node_modules/string-width/node_modules/ansi-regex/readme.md38
-rw-r--r--deps/npm/node_modules/string-width/node_modules/strip-ansi/index.d.ts17
-rw-r--r--deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js2
-rw-r--r--deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json102
-rw-r--r--deps/npm/node_modules/string-width/node_modules/strip-ansi/readme.md17
8 files changed, 211 insertions, 114 deletions
diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.d.ts b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.d.ts
new file mode 100644
index 0000000000..2dbf6af2b6
--- /dev/null
+++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.d.ts
@@ -0,0 +1,37 @@
+declare namespace ansiRegex {
+ interface Options {
+ /**
+ Match only the first ANSI escape.
+
+ @default false
+ */
+ onlyFirst: boolean;
+ }
+}
+
+/**
+Regular expression for matching ANSI escape codes.
+
+@example
+```
+import ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001B[4mcake\u001B[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex());
+//=> ['\u001B[4m', '\u001B[0m']
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
+//=> ['\u001B[4m']
+
+'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
+//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
+```
+*/
+declare function ansiRegex(options?: ansiRegex.Options): RegExp;
+
+export = ansiRegex;
diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
index c4aaecf505..616ff837d3 100644
--- a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
+++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
@@ -1,10 +1,10 @@
'use strict';
-module.exports = () => {
+module.exports = ({onlyFirst = false} = {}) => {
const pattern = [
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');
- return new RegExp(pattern, 'g');
+ return new RegExp(pattern, onlyFirst ? undefined : 'g');
};
diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json
index e94852fd70..017f53116a 100644
--- a/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json
+++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json
@@ -1,53 +1,55 @@
{
- "name": "ansi-regex",
- "version": "3.0.0",
- "description": "Regular expression for matching ANSI escape codes",
- "license": "MIT",
- "repository": "chalk/ansi-regex",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava",
- "view-supported": "node fixtures/view-codes.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern"
- ],
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
+ "name": "ansi-regex",
+ "version": "5.0.1",
+ "description": "Regular expression for matching ANSI escape codes",
+ "license": "MIT",
+ "repository": "chalk/ansi-regex",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd",
+ "view-supported": "node fixtures/view-codes.js"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re",
+ "match",
+ "test",
+ "find",
+ "pattern"
+ ],
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.9.0",
+ "xo": "^0.25.3"
+ }
}
diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/string-width/node_modules/ansi-regex/readme.md
index 22db1c3405..4d848bc36f 100644
--- a/deps/npm/node_modules/string-width/node_modules/ansi-regex/readme.md
+++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/readme.md
@@ -1,4 +1,4 @@
-# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
+# ansi-regex
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
@@ -23,9 +23,33 @@ ansiRegex().test('cake');
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
+//=> ['\u001B[4m']
+
+'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
+//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
```
+## API
+
+### ansiRegex(options?)
+
+Returns a regex for matching ANSI escape codes.
+
+#### options
+
+Type: `object`
+
+##### onlyFirst
+
+Type: `boolean`<br>
+Default: `false` *(Matches any ANSI escape codes in a string)*
+
+Match only the first ANSI escape.
+
+
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
@@ -41,6 +65,14 @@ On the historical side, those ECMA standards were established in the early 90's
- [Josh Junon](https://github.com/qix-)
-## License
+---
-MIT
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.d.ts
new file mode 100644
index 0000000000..907fccc292
--- /dev/null
+++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.d.ts
@@ -0,0 +1,17 @@
+/**
+Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
+
+@example
+```
+import stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001B[4mUnicorn\u001B[0m');
+//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
+```
+*/
+declare function stripAnsi(string: string): string;
+
+export = stripAnsi;
diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js
index 96e0292c8e..9a593dfcd1 100644
--- a/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js
+++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js
@@ -1,4 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');
-module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
+module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json
index 555f194616..1a41108d42 100644
--- a/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json
+++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json
@@ -1,52 +1,54 @@
{
- "name": "strip-ansi",
- "version": "4.0.0",
- "description": "Strip ANSI escape codes",
- "license": "MIT",
- "repository": "chalk/strip-ansi",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "strip",
- "trim",
- "remove",
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-regex": "^3.0.0"
- },
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
+ "name": "strip-ansi",
+ "version": "6.0.1",
+ "description": "Strip ANSI escape codes from a string",
+ "license": "MIT",
+ "repository": "chalk/strip-ansi",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "strip",
+ "trim",
+ "remove",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.10.0",
+ "xo": "^0.25.3"
+ }
}
diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/string-width/node_modules/strip-ansi/readme.md
index dc76f0cb1a..7c4b56d46d 100644
--- a/deps/npm/node_modules/string-width/node_modules/strip-ansi/readme.md
+++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/readme.md
@@ -1,6 +1,6 @@
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
-> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
+> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
## Install
@@ -17,12 +17,23 @@ const stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
```
+## strip-ansi for enterprise
+
+Available as part of the Tidelift Subscription.
+
+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)
+
+
## Related
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
+- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
@@ -33,7 +44,3 @@ stripAnsi('\u001B[4mUnicorn\u001B[0m');
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
-
-## License
-
-MIT