1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = printDisplayName;
|
7 | function _chalk() {
|
8 | const data = _interopRequireDefault(require('chalk'));
|
9 | _chalk = function () {
|
10 | return data;
|
11 | };
|
12 | return data;
|
13 | }
|
14 | function _interopRequireDefault(obj) {
|
15 | return obj && obj.__esModule ? obj : {default: obj};
|
16 | }
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | function printDisplayName(config) {
|
25 | const {displayName} = config;
|
26 | const white = _chalk().default.reset.inverse.white;
|
27 | if (!displayName) {
|
28 | return '';
|
29 | }
|
30 | const {name, color} = displayName;
|
31 | const chosenColor = _chalk().default.reset.inverse[color]
|
32 | ? _chalk().default.reset.inverse[color]
|
33 | : white;
|
34 | return _chalk().default.supportsColor ? chosenColor(` ${name} `) : name;
|
35 | }
|