1 | ;
|
2 |
|
3 | /* eslint-disable prefer-rest-params */
|
4 |
|
5 | const die = process.exit.bind(process);
|
6 |
|
7 | function extend(target) {
|
8 | Array.prototype.slice.call(arguments, 1).forEach(source => {
|
9 | Object.keys(source).forEach(key => {
|
10 | /* istanbul ignore else */
|
11 | if (typeof target[key] === 'undefined') {
|
12 | target[key] = source[key];
|
13 | }
|
14 | });
|
15 | });
|
16 |
|
17 | return target;
|
18 | }
|
19 |
|
20 | function padding(value, max) {
|
21 | return `${value}${new Array(value.length + max).join(' ')}`.substr(0, max);
|
22 | }
|
23 |
|
24 | module.exports = {
|
25 | die,
|
26 | extend,
|
27 | padding,
|
28 | };
|