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,471 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_1t773kz97a = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/validateTableData.js',
9
- hash = '2e262b14db7cdd95b95ae38fca6a5037d2aa3bd7',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/validateTableData.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 16,
18
- column: 2
19
- },
20
- end: {
21
- line: 18,
22
- column: 3
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 17,
28
- column: 4
29
- },
30
- end: {
31
- line: 17,
32
- column: 52
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 20,
38
- column: 2
39
- },
40
- end: {
41
- line: 22,
42
- column: 3
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 21,
48
- column: 4
49
- },
50
- end: {
51
- line: 21,
52
- column: 59
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 24,
58
- column: 2
59
- },
60
- end: {
61
- line: 26,
62
- column: 3
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 25,
68
- column: 4
69
- },
70
- end: {
71
- line: 25,
72
- column: 62
73
- }
74
- },
75
- '6': {
76
- start: {
77
- line: 28,
78
- column: 23
79
- },
80
- end: {
81
- line: 28,
82
- column: 37
83
- }
84
- },
85
- '7': {
86
- start: {
87
- line: 30,
88
- column: 2
89
- },
90
- end: {
91
- line: 46,
92
- column: 5
93
- }
94
- },
95
- '8': {
96
- start: {
97
- line: 31,
98
- column: 4
99
- },
100
- end: {
101
- line: 33,
102
- column: 5
103
- }
104
- },
105
- '9': {
106
- start: {
107
- line: 32,
108
- column: 6
109
- },
110
- end: {
111
- line: 32,
112
- column: 58
113
- }
114
- },
115
- '10': {
116
- start: {
117
- line: 35,
118
- column: 4
119
- },
120
- end: {
121
- line: 37,
122
- column: 5
123
- }
124
- },
125
- '11': {
126
- start: {
127
- line: 36,
128
- column: 6
129
- },
130
- end: {
131
- line: 36,
132
- column: 71
133
- }
134
- },
135
- '12': {
136
- start: {
137
- line: 41,
138
- column: 4
139
- },
140
- end: {
141
- line: 45,
142
- column: 7
143
- }
144
- },
145
- '13': {
146
- start: {
147
- line: 42,
148
- column: 6
149
- },
150
- end: {
151
- line: 44,
152
- column: 7
153
- }
154
- },
155
- '14': {
156
- start: {
157
- line: 43,
158
- column: 8
159
- },
160
- end: {
161
- line: 43,
162
- column: 75
163
- }
164
- }
165
- },
166
- fnMap: {
167
- '0': {
168
- name: '(anonymous_0)',
169
- decl: {
170
- start: {
171
- line: 15,
172
- column: 15
173
- },
174
- end: {
175
- line: 15,
176
- column: 16
177
- }
178
- },
179
- loc: {
180
- start: {
181
- line: 15,
182
- column: 25
183
- },
184
- end: {
185
- line: 47,
186
- column: 1
187
- }
188
- }
189
- },
190
- '1': {
191
- name: '(anonymous_1)',
192
- decl: {
193
- start: {
194
- line: 30,
195
- column: 18
196
- },
197
- end: {
198
- line: 30,
199
- column: 19
200
- }
201
- },
202
- loc: {
203
- start: {
204
- line: 30,
205
- column: 29
206
- },
207
- end: {
208
- line: 46,
209
- column: 3
210
- }
211
- }
212
- },
213
- '2': {
214
- name: '(anonymous_2)',
215
- decl: {
216
- start: {
217
- line: 41,
218
- column: 21
219
- },
220
- end: {
221
- line: 41,
222
- column: 22
223
- }
224
- },
225
- loc: {
226
- start: {
227
- line: 41,
228
- column: 31
229
- },
230
- end: {
231
- line: 45,
232
- column: 5
233
- }
234
- }
235
- }
236
- },
237
- branchMap: {
238
- '0': {
239
- loc: {
240
- start: {
241
- line: 16,
242
- column: 2
243
- },
244
- end: {
245
- line: 18,
246
- column: 3
247
- }
248
- },
249
- type: 'if',
250
- locations: [{
251
- start: {
252
- line: 16,
253
- column: 2
254
- },
255
- end: {
256
- line: 18,
257
- column: 3
258
- }
259
- }, {
260
- start: {
261
- line: 16,
262
- column: 2
263
- },
264
- end: {
265
- line: 18,
266
- column: 3
267
- }
268
- }]
269
- },
270
- '1': {
271
- loc: {
272
- start: {
273
- line: 20,
274
- column: 2
275
- },
276
- end: {
277
- line: 22,
278
- column: 3
279
- }
280
- },
281
- type: 'if',
282
- locations: [{
283
- start: {
284
- line: 20,
285
- column: 2
286
- },
287
- end: {
288
- line: 22,
289
- column: 3
290
- }
291
- }, {
292
- start: {
293
- line: 20,
294
- column: 2
295
- },
296
- end: {
297
- line: 22,
298
- column: 3
299
- }
300
- }]
301
- },
302
- '2': {
303
- loc: {
304
- start: {
305
- line: 24,
306
- column: 2
307
- },
308
- end: {
309
- line: 26,
310
- column: 3
311
- }
312
- },
313
- type: 'if',
314
- locations: [{
315
- start: {
316
- line: 24,
317
- column: 2
318
- },
319
- end: {
320
- line: 26,
321
- column: 3
322
- }
323
- }, {
324
- start: {
325
- line: 24,
326
- column: 2
327
- },
328
- end: {
329
- line: 26,
330
- column: 3
331
- }
332
- }]
333
- },
334
- '3': {
335
- loc: {
336
- start: {
337
- line: 31,
338
- column: 4
339
- },
340
- end: {
341
- line: 33,
342
- column: 5
343
- }
344
- },
345
- type: 'if',
346
- locations: [{
347
- start: {
348
- line: 31,
349
- column: 4
350
- },
351
- end: {
352
- line: 33,
353
- column: 5
354
- }
355
- }, {
356
- start: {
357
- line: 31,
358
- column: 4
359
- },
360
- end: {
361
- line: 33,
362
- column: 5
363
- }
364
- }]
365
- },
366
- '4': {
367
- loc: {
368
- start: {
369
- line: 35,
370
- column: 4
371
- },
372
- end: {
373
- line: 37,
374
- column: 5
375
- }
376
- },
377
- type: 'if',
378
- locations: [{
379
- start: {
380
- line: 35,
381
- column: 4
382
- },
383
- end: {
384
- line: 37,
385
- column: 5
386
- }
387
- }, {
388
- start: {
389
- line: 35,
390
- column: 4
391
- },
392
- end: {
393
- line: 37,
394
- column: 5
395
- }
396
- }]
397
- },
398
- '5': {
399
- loc: {
400
- start: {
401
- line: 42,
402
- column: 6
403
- },
404
- end: {
405
- line: 44,
406
- column: 7
407
- }
408
- },
409
- type: 'if',
410
- locations: [{
411
- start: {
412
- line: 42,
413
- column: 6
414
- },
415
- end: {
416
- line: 44,
417
- column: 7
418
- }
419
- }, {
420
- start: {
421
- line: 42,
422
- column: 6
423
- },
424
- end: {
425
- line: 44,
426
- column: 7
427
- }
428
- }]
429
- }
430
- },
431
- s: {
432
- '0': 0,
433
- '1': 0,
434
- '2': 0,
435
- '3': 0,
436
- '4': 0,
437
- '5': 0,
438
- '6': 0,
439
- '7': 0,
440
- '8': 0,
441
- '9': 0,
442
- '10': 0,
443
- '11': 0,
444
- '12': 0,
445
- '13': 0,
446
- '14': 0
447
- },
448
- f: {
449
- '0': 0,
450
- '1': 0,
451
- '2': 0
452
- },
453
- b: {
454
- '0': [0, 0],
455
- '1': [0, 0],
456
- '2': [0, 0],
457
- '3': [0, 0],
458
- '4': [0, 0],
459
- '5': [0, 0]
460
- }
461
- },
462
- coverage = global[gcv] || (global[gcv] = {});
463
-
464
- if (coverage[path] && coverage[path].hash === hash) {
465
- return coverage[path];
466
- }
467
-
468
- coverageData.hash = hash;
469
- return coverage[path] = coverageData;
470
- }();
471
-
472
7
  var _lodash = require('lodash');
473
8
 
474
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -488,78 +23,34 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
488
23
  * @returns {undefined}
489
24
  */
490
25
  exports.default = rows => {
491
- ++cov_1t773kz97a.f[0];
492
- ++cov_1t773kz97a.s[0];
493
-
494
26
  if (!_lodash2.default.isArray(rows)) {
495
- ++cov_1t773kz97a.b[0][0];
496
- ++cov_1t773kz97a.s[1];
497
-
498
27
  throw new Error('Table data must be an array.');
499
- } else {
500
- ++cov_1t773kz97a.b[0][1];
501
28
  }
502
29
 
503
- ++cov_1t773kz97a.s[2];
504
30
  if (rows.length === 0) {
505
- ++cov_1t773kz97a.b[1][0];
506
- ++cov_1t773kz97a.s[3];
507
-
508
31
  throw new Error('Table must define at least one row.');
509
- } else {
510
- ++cov_1t773kz97a.b[1][1];
511
32
  }
512
33
 
513
- ++cov_1t773kz97a.s[4];
514
34
  if (rows[0].length === 0) {
515
- ++cov_1t773kz97a.b[2][0];
516
- ++cov_1t773kz97a.s[5];
517
-
518
35
  throw new Error('Table must define at least one column.');
519
- } else {
520
- ++cov_1t773kz97a.b[2][1];
521
36
  }
522
37
 
523
- const columnNumber = (++cov_1t773kz97a.s[6], rows[0].length);
38
+ const columnNumber = rows[0].length;
524
39
 
525
- ++cov_1t773kz97a.s[7];
526
40
  _lodash2.default.forEach(rows, cells => {
527
- ++cov_1t773kz97a.f[1];
528
- ++cov_1t773kz97a.s[8];
529
-
530
41
  if (!_lodash2.default.isArray(cells)) {
531
- ++cov_1t773kz97a.b[3][0];
532
- ++cov_1t773kz97a.s[9];
533
-
534
42
  throw new Error('Table row data must be an array.');
535
- } else {
536
- ++cov_1t773kz97a.b[3][1];
537
43
  }
538
44
 
539
- ++cov_1t773kz97a.s[10];
540
45
  if (cells.length !== columnNumber) {
541
- ++cov_1t773kz97a.b[4][0];
542
- ++cov_1t773kz97a.s[11];
543
-
544
46
  throw new Error('Table must have a consistent number of cells.');
545
- } else {
546
- ++cov_1t773kz97a.b[4][1];
547
47
  }
548
48
 
549
49
  // @todo Make an exception for newline characters.
550
50
  // @see https://github.com/gajus/table/issues/9
551
- ++cov_1t773kz97a.s[12];
552
51
  _lodash2.default.forEach(cells, cell => {
553
- ++cov_1t773kz97a.f[2];
554
- ++cov_1t773kz97a.s[13];
555
-
556
52
  if (/[\x01-\x1A]/.test(cell)) {
557
- ++cov_1t773kz97a.b[5][0];
558
- ++cov_1t773kz97a.s[14];
559
-
560
53
  throw new Error('Table data must not contain control characters.');
561
- } else {
562
- ++cov_1t773kz97a.b[5][1];
563
54
  }
564
55
  });
565
56
  });
@@ -4,124 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_2j1tsrxplw = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/wrapString.js',
9
- hash = '15b178ad978dad5acb4b258f96afd96dfca6bd54',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/wrapString.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 19,
18
- column: 2
19
- },
20
- end: {
21
- line: 19,
22
- column: 25
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 21,
28
- column: 17
29
- },
30
- end: {
31
- line: 21,
32
- column: 19
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 23,
38
- column: 2
39
- },
40
- end: {
41
- line: 27,
42
- column: 38
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 24,
48
- column: 4
49
- },
50
- end: {
51
- line: 24,
52
- column: 46
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 26,
58
- column: 4
59
- },
60
- end: {
61
- line: 26,
62
- column: 53
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 29,
68
- column: 2
69
- },
70
- end: {
71
- line: 29,
72
- column: 16
73
- }
74
- }
75
- },
76
- fnMap: {
77
- '0': {
78
- name: '(anonymous_0)',
79
- decl: {
80
- start: {
81
- line: 16,
82
- column: 15
83
- },
84
- end: {
85
- line: 16,
86
- column: 16
87
- }
88
- },
89
- loc: {
90
- start: {
91
- line: 16,
92
- column: 34
93
- },
94
- end: {
95
- line: 30,
96
- column: 1
97
- }
98
- }
99
- }
100
- },
101
- branchMap: {},
102
- s: {
103
- '0': 0,
104
- '1': 0,
105
- '2': 0,
106
- '3': 0,
107
- '4': 0,
108
- '5': 0
109
- },
110
- f: {
111
- '0': 0
112
- },
113
- b: {}
114
- },
115
- coverage = global[gcv] || (global[gcv] = {});
116
-
117
- if (coverage[path] && coverage[path].hash === hash) {
118
- return coverage[path];
119
- }
120
-
121
- coverageData.hash = hash;
122
- return coverage[path] = coverageData;
123
- }();
124
-
125
7
  var _lodash = require('lodash');
126
8
 
127
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -148,26 +30,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
148
30
  * @returns {Array}
149
31
  */
150
32
  exports.default = (subject, size) => {
151
- ++cov_2j1tsrxplw.f[0];
152
-
153
33
  let subjectSlice;
154
34
 
155
- ++cov_2j1tsrxplw.s[0];
156
35
  subjectSlice = subject;
157
36
 
158
- const chunks = (++cov_2j1tsrxplw.s[1], []);
37
+ const chunks = [];
159
38
 
160
- ++cov_2j1tsrxplw.s[2];
161
39
  do {
162
- ++cov_2j1tsrxplw.s[3];
163
-
164
40
  chunks.push((0, _sliceAnsi2.default)(subjectSlice, 0, size));
165
41
 
166
- ++cov_2j1tsrxplw.s[4];
167
42
  subjectSlice = _lodash2.default.trim((0, _sliceAnsi2.default)(subjectSlice, size));
168
43
  } while ((0, _stringWidth2.default)(subjectSlice));
169
44
 
170
- ++cov_2j1tsrxplw.s[5];
171
45
  return chunks;
172
46
  };
173
47