Skip to content

Commit cc57c8a

Browse files
committed
deps: use picocolors
1 parent c9d640f commit cc57c8a

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

lib/formatters/console.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import chalk from 'chalk';
1+
import picocolors from 'picocolors';
22
import BaseFormatter from './base.js';
33

4-
function chalkColor(name) {
4+
function color(name) {
55
return (
6-
(chalk && chalk[name]) ||
6+
(picocolors && picocolors[name]) ||
77
function(...args) {
88
return args;
99
}
1010
);
1111
}
1212

1313
let colors = {
14-
added: chalkColor('green'),
15-
deleted: chalkColor('red'),
16-
movedestination: chalkColor('gray'),
17-
moved: chalkColor('yellow'),
18-
unchanged: chalkColor('gray'),
19-
error: chalkColor('white.bgRed'),
20-
textDiffLine: chalkColor('gray'),
14+
added: color('green'),
15+
deleted: color('red'),
16+
movedestination: color('gray'),
17+
moved: color('yellow'),
18+
unchanged: color('gray'),
19+
error: text => color('white')(color('bgRed')(text)),
20+
textDiffLine: color('gray'),
2121
};
2222

2323
export default class ConsoleFormatter extends BaseFormatter {

package-lock.json

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"patch"
3131
],
3232
"dependencies": {
33-
"chalk": "^2.3.0",
34-
"diff-match-patch": "^1.0.0"
33+
"diff-match-patch": "^1.0.0",
34+
"picocolors": "^1.0.1"
3535
},
3636
"devDependencies": {
3737
"chai": "^5.1.1",

0 commit comments

Comments
 (0)