Skip to content

Commit 91065e4

Browse files
author
Pooya Parsa
committed
perf: require needed lodash methods only
1 parent b50cad8 commit 91065e4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/reporters/fancy.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import chalk from 'chalk'
22
import figures from 'figures'
3-
import _ from 'lodash'
3+
import startCase from 'lodash/startCase'
44

55
const NS_SEPERATOR = chalk.blue(figures(' › '))
66

@@ -17,20 +17,18 @@ const ICONS = {
1717
ready: figures('♥')
1818
}
1919

20-
const pad = str => _.padEnd(str, 9)
21-
2220
export default class FancyReporter {
2321
constructor (stream, options = {}) {
2422
this.stream = stream || process.stderr
2523
}
2624

2725
formatBadge (type, color = 'blue') {
28-
return chalk['bg' + _.startCase(color)].black(` ${type.toUpperCase()} `) + ' '
26+
return chalk['bg' + startCase(color)].black(` ${type.toUpperCase()} `) + ' '
2927
}
3028

3129
formatTag (type, color = 'blue') {
3230
const icon = ICONS[type] || ICONS.default
33-
return chalk[color](pad(`${icon} ${type.toLowerCase()}`)) + ' '
31+
return chalk[color](`${icon} ${type.toLowerCase()}`) + ' '
3432
}
3533

3634
clear () {

0 commit comments

Comments
 (0)