ansi-regex 4.0.0 → 4.1.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.
- package/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +22 -0
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = options => {
|
|
|
6
6
|
}, options);
|
|
7
7
|
|
|
8
8
|
const pattern = [
|
|
9
|
-
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
|
|
9
|
+
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
|
10
10
|
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
|
11
11
|
].join('|');
|
|
12
12
|
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
|
4
4
|
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<b>
|
|
9
|
+
<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>
|
|
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
20
|
## Install
|
|
7
21
|
|
|
@@ -26,6 +40,9 @@ ansiRegex().test('cake');
|
|
|
26
40
|
|
|
27
41
|
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
|
28
42
|
//=> ['\u001B[4m']
|
|
43
|
+
|
|
44
|
+
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
|
45
|
+
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
|
29
46
|
```
|
|
30
47
|
|
|
31
48
|
|
|
@@ -54,6 +71,11 @@ Some of the codes we run as a test are codes that we acquired finding various li
|
|
|
54
71
|
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
|
55
72
|
|
|
56
73
|
|
|
74
|
+
## Security
|
|
75
|
+
|
|
76
|
+
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
|
77
|
+
|
|
78
|
+
|
|
57
79
|
## Maintainers
|
|
58
80
|
|
|
59
81
|
- [Sindre Sorhus](https://github.com/sindresorhus)
|