table 3.8.2 → 3.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,547 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_3c92k3xh1 = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/makeStreamConfig.js',
9
- hash = 'a51cd8d347bf6e0ccdfb4ff4cb6c763d2f8b1f98',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/makeStreamConfig.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 11,
18
- column: 19
19
- },
20
- end: {
21
- line: 13,
22
- column: 1
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 12,
28
- column: 2
29
- },
30
- end: {
31
- line: 12,
32
- column: 64
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 24,
38
- column: 20
39
- },
40
- end: {
41
- line: 40,
42
- column: 1
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 25,
48
- column: 2
49
- },
50
- end: {
51
- line: 37,
52
- column: 5
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 26,
58
- column: 4
59
- },
60
- end: {
61
- line: 28,
62
- column: 5
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 27,
68
- column: 6
69
- },
70
- end: {
71
- line: 27,
72
- column: 26
73
- }
74
- },
75
- '6': {
76
- start: {
77
- line: 30,
78
- column: 4
79
- },
80
- end: {
81
- line: 36,
82
- column: 38
83
- }
84
- },
85
- '7': {
86
- start: {
87
- line: 39,
88
- column: 2
89
- },
90
- end: {
91
- line: 39,
92
- column: 17
93
- }
94
- },
95
- '8': {
96
- start: {
97
- line: 67,
98
- column: 2
99
- },
100
- end: {
101
- line: 67,
102
- column: 50
103
- }
104
- },
105
- '9': {
106
- start: {
107
- line: 69,
108
- column: 17
109
- },
110
- end: {
111
- line: 69,
112
- column: 40
113
- }
114
- },
115
- '10': {
116
- start: {
117
- line: 71,
118
- column: 2
119
- },
120
- end: {
121
- line: 73,
122
- column: 3
123
- }
124
- },
125
- '11': {
126
- start: {
127
- line: 72,
128
- column: 4
129
- },
130
- end: {
131
- line: 72,
132
- column: 87
133
- }
134
- },
135
- '12': {
136
- start: {
137
- line: 75,
138
- column: 2
139
- },
140
- end: {
141
- line: 77,
142
- column: 3
143
- }
144
- },
145
- '13': {
146
- start: {
147
- line: 76,
148
- column: 4
149
- },
150
- end: {
151
- line: 76,
152
- column: 56
153
- }
154
- },
155
- '14': {
156
- start: {
157
- line: 79,
158
- column: 2
159
- },
160
- end: {
161
- line: 79,
162
- column: 44
163
- }
164
- },
165
- '15': {
166
- start: {
167
- line: 80,
168
- column: 2
169
- },
170
- end: {
171
- line: 80,
172
- column: 89
173
- }
174
- },
175
- '16': {
176
- start: {
177
- line: 82,
178
- column: 2
179
- },
180
- end: {
181
- line: 82,
182
- column: 16
183
- }
184
- }
185
- },
186
- fnMap: {
187
- '0': {
188
- name: '(anonymous_0)',
189
- decl: {
190
- start: {
191
- line: 11,
192
- column: 19
193
- },
194
- end: {
195
- line: 11,
196
- column: 20
197
- }
198
- },
199
- loc: {
200
- start: {
201
- line: 11,
202
- column: 36
203
- },
204
- end: {
205
- line: 13,
206
- column: 1
207
- }
208
- }
209
- },
210
- '1': {
211
- name: '(anonymous_1)',
212
- decl: {
213
- start: {
214
- line: 24,
215
- column: 20
216
- },
217
- end: {
218
- line: 24,
219
- column: 21
220
- }
221
- },
222
- loc: {
223
- start: {
224
- line: 24,
225
- column: 71
226
- },
227
- end: {
228
- line: 40,
229
- column: 1
230
- }
231
- }
232
- },
233
- '2': {
234
- name: '(anonymous_2)',
235
- decl: {
236
- start: {
237
- line: 25,
238
- column: 23
239
- },
240
- end: {
241
- line: 25,
242
- column: 24
243
- }
244
- },
245
- loc: {
246
- start: {
247
- line: 25,
248
- column: 34
249
- },
250
- end: {
251
- line: 37,
252
- column: 3
253
- }
254
- }
255
- },
256
- '3': {
257
- name: '(anonymous_3)',
258
- decl: {
259
- start: {
260
- line: 66,
261
- column: 15
262
- },
263
- end: {
264
- line: 66,
265
- column: 16
266
- }
267
- },
268
- loc: {
269
- start: {
270
- line: 66,
271
- column: 36
272
- },
273
- end: {
274
- line: 83,
275
- column: 1
276
- }
277
- }
278
- }
279
- },
280
- branchMap: {
281
- '0': {
282
- loc: {
283
- start: {
284
- line: 11,
285
- column: 20
286
- },
287
- end: {
288
- line: 11,
289
- column: 31
290
- }
291
- },
292
- type: 'default-arg',
293
- locations: [{
294
- start: {
295
- line: 11,
296
- column: 29
297
- },
298
- end: {
299
- line: 11,
300
- column: 31
301
- }
302
- }]
303
- },
304
- '1': {
305
- loc: {
306
- start: {
307
- line: 24,
308
- column: 34
309
- },
310
- end: {
311
- line: 24,
312
- column: 46
313
- }
314
- },
315
- type: 'default-arg',
316
- locations: [{
317
- start: {
318
- line: 24,
319
- column: 44
320
- },
321
- end: {
322
- line: 24,
323
- column: 46
324
- }
325
- }]
326
- },
327
- '2': {
328
- loc: {
329
- start: {
330
- line: 24,
331
- column: 48
332
- },
333
- end: {
334
- line: 24,
335
- column: 66
336
- }
337
- },
338
- type: 'default-arg',
339
- locations: [{
340
- start: {
341
- line: 24,
342
- column: 64
343
- },
344
- end: {
345
- line: 24,
346
- column: 66
347
- }
348
- }]
349
- },
350
- '3': {
351
- loc: {
352
- start: {
353
- line: 26,
354
- column: 4
355
- },
356
- end: {
357
- line: 28,
358
- column: 5
359
- }
360
- },
361
- type: 'if',
362
- locations: [{
363
- start: {
364
- line: 26,
365
- column: 4
366
- },
367
- end: {
368
- line: 28,
369
- column: 5
370
- }
371
- }, {
372
- start: {
373
- line: 26,
374
- column: 4
375
- },
376
- end: {
377
- line: 28,
378
- column: 5
379
- }
380
- }]
381
- },
382
- '4': {
383
- loc: {
384
- start: {
385
- line: 66,
386
- column: 16
387
- },
388
- end: {
389
- line: 66,
390
- column: 31
391
- }
392
- },
393
- type: 'default-arg',
394
- locations: [{
395
- start: {
396
- line: 66,
397
- column: 29
398
- },
399
- end: {
400
- line: 66,
401
- column: 31
402
- }
403
- }]
404
- },
405
- '5': {
406
- loc: {
407
- start: {
408
- line: 71,
409
- column: 2
410
- },
411
- end: {
412
- line: 73,
413
- column: 3
414
- }
415
- },
416
- type: 'if',
417
- locations: [{
418
- start: {
419
- line: 71,
420
- column: 2
421
- },
422
- end: {
423
- line: 73,
424
- column: 3
425
- }
426
- }, {
427
- start: {
428
- line: 71,
429
- column: 2
430
- },
431
- end: {
432
- line: 73,
433
- column: 3
434
- }
435
- }]
436
- },
437
- '6': {
438
- loc: {
439
- start: {
440
- line: 71,
441
- column: 6
442
- },
443
- end: {
444
- line: 71,
445
- column: 58
446
- }
447
- },
448
- type: 'binary-expr',
449
- locations: [{
450
- start: {
451
- line: 71,
452
- column: 6
453
- },
454
- end: {
455
- line: 71,
456
- column: 27
457
- }
458
- }, {
459
- start: {
460
- line: 71,
461
- column: 31
462
- },
463
- end: {
464
- line: 71,
465
- column: 58
466
- }
467
- }]
468
- },
469
- '7': {
470
- loc: {
471
- start: {
472
- line: 75,
473
- column: 2
474
- },
475
- end: {
476
- line: 77,
477
- column: 3
478
- }
479
- },
480
- type: 'if',
481
- locations: [{
482
- start: {
483
- line: 75,
484
- column: 2
485
- },
486
- end: {
487
- line: 77,
488
- column: 3
489
- }
490
- }, {
491
- start: {
492
- line: 75,
493
- column: 2
494
- },
495
- end: {
496
- line: 77,
497
- column: 3
498
- }
499
- }]
500
- }
501
- },
502
- s: {
503
- '0': 0,
504
- '1': 0,
505
- '2': 0,
506
- '3': 0,
507
- '4': 0,
508
- '5': 0,
509
- '6': 0,
510
- '7': 0,
511
- '8': 0,
512
- '9': 0,
513
- '10': 0,
514
- '11': 0,
515
- '12': 0,
516
- '13': 0,
517
- '14': 0,
518
- '15': 0,
519
- '16': 0
520
- },
521
- f: {
522
- '0': 0,
523
- '1': 0,
524
- '2': 0,
525
- '3': 0
526
- },
527
- b: {
528
- '0': [0],
529
- '1': [0],
530
- '2': [0],
531
- '3': [0, 0],
532
- '4': [0],
533
- '5': [0, 0],
534
- '6': [0, 0],
535
- '7': [0, 0]
536
- }
537
- },
538
- coverage = global[gcv] || (global[gcv] = {});
539
-
540
- if (coverage[path] && coverage[path].hash === hash) {
541
- return coverage[path];
542
- }
543
-
544
- coverageData.hash = hash;
545
- return coverage[path] = coverageData;
546
- }();
547
-
548
7
  var _lodash = require('lodash');
549
8
 
550
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -565,13 +24,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
565
24
  * @param {Object} border
566
25
  * @returns {Object}
567
26
  */
568
- const makeBorder = (++cov_3c92k3xh1.s[0], function () {
569
- let border = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (++cov_3c92k3xh1.b[0][0], {});
570
- ++cov_3c92k3xh1.f[0];
571
- ++cov_3c92k3xh1.s[1];
27
+ const makeBorder = function makeBorder() {
28
+ let border = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
572
29
 
573
30
  return _lodash2.default.assign({}, (0, _getBorderCharacters2.default)('honeywell'), border);
574
- });
31
+ };
575
32
 
576
33
  /**
577
34
  * Creates a configuration for every column using default
@@ -582,26 +39,15 @@ const makeBorder = (++cov_3c92k3xh1.s[0], function () {
582
39
  * @param {Object} columnDefault
583
40
  * @returns {Object}
584
41
  */
585
- const makeColumns = (++cov_3c92k3xh1.s[2], function (columnCount) {
586
- let columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (++cov_3c92k3xh1.b[1][0], {});
587
- let columnDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (++cov_3c92k3xh1.b[2][0], {});
588
- ++cov_3c92k3xh1.f[1];
589
- ++cov_3c92k3xh1.s[3];
42
+ const makeColumns = function makeColumns(columnCount) {
43
+ let columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
44
+ let columnDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
590
45
 
591
46
  _lodash2.default.times(columnCount, index => {
592
- ++cov_3c92k3xh1.f[2];
593
- ++cov_3c92k3xh1.s[4];
594
-
595
47
  if (_lodash2.default.isUndefined(columns[index])) {
596
- ++cov_3c92k3xh1.b[3][0];
597
- ++cov_3c92k3xh1.s[5];
598
-
599
48
  columns[index] = {};
600
- } else {
601
- ++cov_3c92k3xh1.b[3][1];
602
49
  }
603
50
 
604
- ++cov_3c92k3xh1.s[6];
605
51
  columns[index] = _lodash2.default.assign({
606
52
  alignment: 'left',
607
53
  paddingLeft: 1,
@@ -611,9 +57,8 @@ const makeColumns = (++cov_3c92k3xh1.s[2], function (columnCount) {
611
57
  }, columnDefault, columns[index]);
612
58
  });
613
59
 
614
- ++cov_3c92k3xh1.s[7];
615
60
  return columns;
616
- });
61
+ };
617
62
 
618
63
  /**
619
64
  * @typedef {Object} columnConfig
@@ -641,40 +86,23 @@ const makeColumns = (++cov_3c92k3xh1.s[2], function (columnCount) {
641
86
  */
642
87
 
643
88
  exports.default = function () {
644
- let userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (++cov_3c92k3xh1.b[4][0], {});
645
- ++cov_3c92k3xh1.f[3];
646
- ++cov_3c92k3xh1.s[8];
89
+ let userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
647
90
 
648
91
  (0, _validateConfig2.default)('streamConfig.json', userConfig);
649
92
 
650
- const config = (++cov_3c92k3xh1.s[9], _lodash2.default.cloneDeep(userConfig));
651
-
652
- ++cov_3c92k3xh1.s[10];
653
- if ((++cov_3c92k3xh1.b[6][0], !config.columnDefault) || (++cov_3c92k3xh1.b[6][1], !config.columnDefault.width)) {
654
- ++cov_3c92k3xh1.b[5][0];
655
- ++cov_3c92k3xh1.s[11];
93
+ const config = _lodash2.default.cloneDeep(userConfig);
656
94
 
95
+ if (!config.columnDefault || !config.columnDefault.width) {
657
96
  throw new Error('Must provide config.columnDefault.width when creating a stream.');
658
- } else {
659
- ++cov_3c92k3xh1.b[5][1];
660
97
  }
661
98
 
662
- ++cov_3c92k3xh1.s[12];
663
99
  if (!config.columnCount) {
664
- ++cov_3c92k3xh1.b[7][0];
665
- ++cov_3c92k3xh1.s[13];
666
-
667
100
  throw new Error('Must provide config.columnCount.');
668
- } else {
669
- ++cov_3c92k3xh1.b[7][1];
670
101
  }
671
102
 
672
- ++cov_3c92k3xh1.s[14];
673
103
  config.border = makeBorder(config.border);
674
- ++cov_3c92k3xh1.s[15];
675
104
  config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);
676
105
 
677
- ++cov_3c92k3xh1.s[16];
678
106
  return config;
679
107
  };
680
108