Total Complexity | 6 |
Complexity/F | 1.2 |
Lines of Code | 41 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | "use strict"; |
||
2 | |||
3 | import constants from "./constants"; |
||
4 | import _ from "lodash"; |
||
5 | |||
6 | var settings = constants.defaultSettings; |
||
7 | |||
8 | function setSettings(options?: any) { |
||
9 | if (!options) { |
||
10 | return _.merge(constants.defaultSettings, {}); |
||
11 | } |
||
12 | |||
13 | return _.merge(settings, options); |
||
14 | } |
||
15 | |||
16 | function width() { |
||
17 | return settings.width; |
||
18 | } |
||
19 | |||
20 | function prefix() { |
||
21 | return settings.prefix; |
||
22 | } |
||
23 | |||
24 | function write(text) { |
||
25 | return settings.write(text); |
||
26 | } |
||
27 | |||
28 | function formatStatus(statusLabel, state) { |
||
29 | return settings.formatStatus(statusLabel, state); |
||
30 | } |
||
31 | |||
32 | settings = setSettings(); |
||
33 | |||
34 | export = { |
||
35 | setSettings: setSettings, |
||
36 | width: width, |
||
37 | prefix: prefix, |
||
38 | write: write, |
||
39 | formatStatus: formatStatus, |
||
40 | }; |
||
41 |