ansi-regex
Advanced tools
Comparing version 6.0.1 to 6.1.0
@@ -1,2 +0,2 @@ | ||
export interface Options { | ||
export type Options = { | ||
/** | ||
@@ -8,3 +8,3 @@ Match only the first ANSI escape. | ||
readonly onlyFirst: boolean; | ||
} | ||
}; | ||
@@ -11,0 +11,0 @@ /** |
export default function ansiRegex({onlyFirst = false} = {}) { | ||
// Valid string terminator sequences are BEL, ESC\, and 0x9c | ||
const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)'; | ||
const pattern = [ | ||
'[\\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=><~]))' | ||
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, | ||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))', | ||
].join('|'); | ||
@@ -6,0 +8,0 @@ |
{ | ||
"name": "ansi-regex", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"description": "Regular expression for matching ANSI escape codes", | ||
@@ -15,2 +15,4 @@ "license": "MIT", | ||
"exports": "./index.js", | ||
"types": "./index.d.ts", | ||
"sideEffects": false, | ||
"engines": { | ||
@@ -55,6 +57,7 @@ "node": ">=12" | ||
"devDependencies": { | ||
"ansi-escapes": "^5.0.0", | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.38.2" | ||
"tsd": "^0.21.0", | ||
"xo": "^0.54.2" | ||
} | ||
} |
@@ -7,5 +7,5 @@ # ansi-regex | ||
```sh | ||
npm install ansi-regex | ||
``` | ||
$ npm install ansi-regex | ||
``` | ||
@@ -62,13 +62,1 @@ ## Usage | ||
- [Josh Junon](https://github.com/qix-) | ||
--- | ||
<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> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34
5412
4
61