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