ansi-styles 3.2.0 → 3.2.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.
- package/index.js +18 -5
- package/package.json +4 -2
- package/readme.md +1 -1
package/index.js
CHANGED
@@ -102,30 +102,43 @@ function assembleStyles() {
|
|
102
102
|
});
|
103
103
|
}
|
104
104
|
|
105
|
+
const ansi2ansi = n => n;
|
105
106
|
const rgb2rgb = (r, g, b) => [r, g, b];
|
106
107
|
|
107
108
|
styles.color.close = '\u001B[39m';
|
108
109
|
styles.bgColor.close = '\u001B[49m';
|
109
110
|
|
110
|
-
styles.color.ansi = {
|
111
|
-
|
111
|
+
styles.color.ansi = {
|
112
|
+
ansi: wrapAnsi16(ansi2ansi, 0)
|
113
|
+
};
|
114
|
+
styles.color.ansi256 = {
|
115
|
+
ansi256: wrapAnsi256(ansi2ansi, 0)
|
116
|
+
};
|
112
117
|
styles.color.ansi16m = {
|
113
118
|
rgb: wrapAnsi16m(rgb2rgb, 0)
|
114
119
|
};
|
115
120
|
|
116
|
-
styles.bgColor.ansi = {
|
117
|
-
|
121
|
+
styles.bgColor.ansi = {
|
122
|
+
ansi: wrapAnsi16(ansi2ansi, 10)
|
123
|
+
};
|
124
|
+
styles.bgColor.ansi256 = {
|
125
|
+
ansi256: wrapAnsi256(ansi2ansi, 10)
|
126
|
+
};
|
118
127
|
styles.bgColor.ansi16m = {
|
119
128
|
rgb: wrapAnsi16m(rgb2rgb, 10)
|
120
129
|
};
|
121
130
|
|
122
|
-
for (
|
131
|
+
for (let key of Object.keys(colorConvert)) {
|
123
132
|
if (typeof colorConvert[key] !== 'object') {
|
124
133
|
continue;
|
125
134
|
}
|
126
135
|
|
127
136
|
const suite = colorConvert[key];
|
128
137
|
|
138
|
+
if (key === 'ansi16') {
|
139
|
+
key = 'ansi';
|
140
|
+
}
|
141
|
+
|
129
142
|
if ('ansi16' in suite) {
|
130
143
|
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
131
144
|
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ansi-styles",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.1",
|
4
4
|
"description": "ANSI escape codes for styling strings in the terminal",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": "chalk/ansi-styles",
|
@@ -13,7 +13,8 @@
|
|
13
13
|
"node": ">=4"
|
14
14
|
},
|
15
15
|
"scripts": {
|
16
|
-
"test": "xo && ava"
|
16
|
+
"test": "xo && ava",
|
17
|
+
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
17
18
|
},
|
18
19
|
"files": [
|
19
20
|
"index.js"
|
@@ -46,6 +47,7 @@
|
|
46
47
|
"devDependencies": {
|
47
48
|
"ava": "*",
|
48
49
|
"babel-polyfill": "^6.23.0",
|
50
|
+
"svg-term-cli": "^2.1.1",
|
49
51
|
"xo": "*"
|
50
52
|
},
|
51
53
|
"ava": {
|
package/readme.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
6
6
|
|
7
|
-
|
7
|
+
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
8
8
|
|
9
9
|
|
10
10
|
## Install
|