Skip to content

Commit a0f4571

Browse files
committed
Refactor code-style
1 parent 1afb3f9 commit a0f4571

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ var yellow = ansiColor(33, 39)
2424
var green = ansiColor(32, 39)
2525

2626
// Define ANSII color removal functionality.
27-
var colorExpression = new RegExp(
28-
'(?:' +
29-
'(?:\\u001b\\[)|' +
30-
'\\u009b' +
31-
')' +
32-
'(?:' +
33-
'(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m]' +
34-
')|' +
35-
'\\u001b[A-M]',
36-
'g'
37-
)
27+
var colorExpression = /(?:(?:\u001B\[)|\u009b)(?:\d{1,3})?(?:(?:;\d{0,3})*)?[A-M|f-m]|\u001b[A-M]/g
3828

3929
// Standard keys defined by unist: https://github.com/syntax-tree/unist.
4030
// We don’t ignore `data` though.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@
6969
"esnext": false,
7070
"rules": {
7171
"unicorn/prefer-number-properties": "off",
72+
"unicorn/prefer-includes": "off",
7273
"guard-for-in": "off",
73-
"unicorn/prefer-includes": "off"
74+
"no-control-regex": "off"
7475
},
7576
"ignore": [
7677
"types",

0 commit comments

Comments
 (0)