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,273 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_qyqm9cd68 = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/calculateMaximumColumnWidthIndex.js',
9
- hash = '879c5b124d777a0bf46104f942ca9def05c6c3af',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/calculateMaximumColumnWidthIndex.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 11,
18
- column: 2
19
- },
20
- end: {
21
- line: 13,
22
- column: 3
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 12,
28
- column: 4
29
- },
30
- end: {
31
- line: 12,
32
- column: 59
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 15,
38
- column: 18
39
- },
40
- end: {
41
- line: 15,
42
- column: 50
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 17,
48
- column: 2
49
- },
50
- end: {
51
- line: 25,
52
- column: 5
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 18,
58
- column: 29
59
- },
60
- end: {
61
- line: 18,
62
- column: 57
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 20,
68
- column: 4
69
- },
70
- end: {
71
- line: 24,
72
- column: 7
73
- }
74
- },
75
- '6': {
76
- start: {
77
- line: 21,
78
- column: 6
79
- },
80
- end: {
81
- line: 23,
82
- column: 7
83
- }
84
- },
85
- '7': {
86
- start: {
87
- line: 22,
88
- column: 8
89
- },
90
- end: {
91
- line: 22,
92
- column: 37
93
- }
94
- },
95
- '8': {
96
- start: {
97
- line: 27,
98
- column: 2
99
- },
100
- end: {
101
- line: 27,
102
- column: 17
103
- }
104
- }
105
- },
106
- fnMap: {
107
- '0': {
108
- name: '(anonymous_0)',
109
- decl: {
110
- start: {
111
- line: 10,
112
- column: 15
113
- },
114
- end: {
115
- line: 10,
116
- column: 16
117
- }
118
- },
119
- loc: {
120
- start: {
121
- line: 10,
122
- column: 25
123
- },
124
- end: {
125
- line: 28,
126
- column: 1
127
- }
128
- }
129
- },
130
- '1': {
131
- name: '(anonymous_1)',
132
- decl: {
133
- start: {
134
- line: 17,
135
- column: 18
136
- },
137
- end: {
138
- line: 17,
139
- column: 19
140
- }
141
- },
142
- loc: {
143
- start: {
144
- line: 17,
145
- column: 27
146
- },
147
- end: {
148
- line: 25,
149
- column: 3
150
- }
151
- }
152
- },
153
- '2': {
154
- name: '(anonymous_2)',
155
- decl: {
156
- start: {
157
- line: 20,
158
- column: 32
159
- },
160
- end: {
161
- line: 20,
162
- column: 33
163
- }
164
- },
165
- loc: {
166
- start: {
167
- line: 20,
168
- column: 56
169
- },
170
- end: {
171
- line: 24,
172
- column: 5
173
- }
174
- }
175
- }
176
- },
177
- branchMap: {
178
- '0': {
179
- loc: {
180
- start: {
181
- line: 11,
182
- column: 2
183
- },
184
- end: {
185
- line: 13,
186
- column: 3
187
- }
188
- },
189
- type: 'if',
190
- locations: [{
191
- start: {
192
- line: 11,
193
- column: 2
194
- },
195
- end: {
196
- line: 13,
197
- column: 3
198
- }
199
- }, {
200
- start: {
201
- line: 11,
202
- column: 2
203
- },
204
- end: {
205
- line: 13,
206
- column: 3
207
- }
208
- }]
209
- },
210
- '1': {
211
- loc: {
212
- start: {
213
- line: 21,
214
- column: 6
215
- },
216
- end: {
217
- line: 23,
218
- column: 7
219
- }
220
- },
221
- type: 'if',
222
- locations: [{
223
- start: {
224
- line: 21,
225
- column: 6
226
- },
227
- end: {
228
- line: 23,
229
- column: 7
230
- }
231
- }, {
232
- start: {
233
- line: 21,
234
- column: 6
235
- },
236
- end: {
237
- line: 23,
238
- column: 7
239
- }
240
- }]
241
- }
242
- },
243
- s: {
244
- '0': 0,
245
- '1': 0,
246
- '2': 0,
247
- '3': 0,
248
- '4': 0,
249
- '5': 0,
250
- '6': 0,
251
- '7': 0,
252
- '8': 0
253
- },
254
- f: {
255
- '0': 0,
256
- '1': 0,
257
- '2': 0
258
- },
259
- b: {
260
- '0': [0, 0],
261
- '1': [0, 0]
262
- }
263
- },
264
- coverage = global[gcv] || (global[gcv] = {});
265
-
266
- if (coverage[path] && coverage[path].hash === hash) {
267
- return coverage[path];
268
- }
269
-
270
- coverageData.hash = hash;
271
- return coverage[path] = coverageData;
272
- }();
273
-
274
7
  var _lodash = require('lodash');
275
8
 
276
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -288,43 +21,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
288
21
  * @returns {number[]}
289
22
  */
290
23
  exports.default = rows => {
291
- ++cov_qyqm9cd68.f[0];
292
- ++cov_qyqm9cd68.s[0];
293
-
294
24
  if (!rows[0]) {
295
- ++cov_qyqm9cd68.b[0][0];
296
- ++cov_qyqm9cd68.s[1];
297
-
298
25
  throw new Error('Dataset must have at least one row.');
299
- } else {
300
- ++cov_qyqm9cd68.b[0][1];
301
26
  }
302
27
 
303
- const columns = (++cov_qyqm9cd68.s[2], _lodash2.default.fill(Array(rows[0].length), 0));
28
+ const columns = _lodash2.default.fill(Array(rows[0].length), 0);
304
29
 
305
- ++cov_qyqm9cd68.s[3];
306
30
  _lodash2.default.forEach(rows, row => {
307
- ++cov_qyqm9cd68.f[1];
31
+ const columnWidthIndex = (0, _calculateCellWidthIndex2.default)(row);
308
32
 
309
- const columnWidthIndex = (++cov_qyqm9cd68.s[4], (0, _calculateCellWidthIndex2.default)(row));
310
-
311
- ++cov_qyqm9cd68.s[5];
312
33
  _lodash2.default.forEach(columnWidthIndex, (valueWidth, index0) => {
313
- ++cov_qyqm9cd68.f[2];
314
- ++cov_qyqm9cd68.s[6];
315
-
316
34
  if (columns[index0] < valueWidth) {
317
- ++cov_qyqm9cd68.b[1][0];
318
- ++cov_qyqm9cd68.s[7];
319
-
320
35
  columns[index0] = valueWidth;
321
- } else {
322
- ++cov_qyqm9cd68.b[1][1];
323
36
  }
324
37
  });
325
38
  });
326
39
 
327
- ++cov_qyqm9cd68.s[8];
328
40
  return columns;
329
41
  };
330
42
 
@@ -4,306 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_161lflitbr = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/calculateRowHeightIndex.js',
9
- hash = '3ea7effa044c58c1829012ae1f0f20e85671abbe',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/calculateRowHeightIndex.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 12,
18
- column: 21
19
- },
20
- end: {
21
- line: 12,
22
- column: 35
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 14,
28
- column: 23
29
- },
30
- end: {
31
- line: 14,
32
- column: 25
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 16,
38
- column: 2
39
- },
40
- end: {
41
- line: 32,
42
- column: 5
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 17,
48
- column: 28
49
- },
50
- end: {
51
- line: 17,
52
- column: 56
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 19,
58
- column: 4
59
- },
60
- end: {
61
- line: 29,
62
- column: 7
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 20,
68
- column: 6
69
- },
70
- end: {
71
- line: 22,
72
- column: 7
73
- }
74
- },
75
- '6': {
76
- start: {
77
- line: 21,
78
- column: 8
79
- },
80
- end: {
81
- line: 21,
82
- column: 65
83
- }
84
- },
85
- '7': {
86
- start: {
87
- line: 24,
88
- column: 6
89
- },
90
- end: {
91
- line: 26,
92
- column: 7
93
- }
94
- },
95
- '8': {
96
- start: {
97
- line: 25,
98
- column: 8
99
- },
100
- end: {
101
- line: 25,
102
- column: 69
103
- }
104
- },
105
- '9': {
106
- start: {
107
- line: 28,
108
- column: 6
109
- },
110
- end: {
111
- line: 28,
112
- column: 122
113
- }
114
- },
115
- '10': {
116
- start: {
117
- line: 31,
118
- column: 4
119
- },
120
- end: {
121
- line: 31,
122
- column: 46
123
- }
124
- },
125
- '11': {
126
- start: {
127
- line: 34,
128
- column: 2
129
- },
130
- end: {
131
- line: 34,
132
- column: 22
133
- }
134
- }
135
- },
136
- fnMap: {
137
- '0': {
138
- name: '(anonymous_0)',
139
- decl: {
140
- start: {
141
- line: 11,
142
- column: 15
143
- },
144
- end: {
145
- line: 11,
146
- column: 16
147
- }
148
- },
149
- loc: {
150
- start: {
151
- line: 11,
152
- column: 33
153
- },
154
- end: {
155
- line: 35,
156
- column: 1
157
- }
158
- }
159
- },
160
- '1': {
161
- name: '(anonymous_1)',
162
- decl: {
163
- start: {
164
- line: 16,
165
- column: 18
166
- },
167
- end: {
168
- line: 16,
169
- column: 19
170
- }
171
- },
172
- loc: {
173
- start: {
174
- line: 16,
175
- column: 29
176
- },
177
- end: {
178
- line: 32,
179
- column: 3
180
- }
181
- }
182
- },
183
- '2': {
184
- name: '(anonymous_2)',
185
- decl: {
186
- start: {
187
- line: 19,
188
- column: 21
189
- },
190
- end: {
191
- line: 19,
192
- column: 22
193
- }
194
- },
195
- loc: {
196
- start: {
197
- line: 19,
198
- column: 40
199
- },
200
- end: {
201
- line: 29,
202
- column: 5
203
- }
204
- }
205
- }
206
- },
207
- branchMap: {
208
- '0': {
209
- loc: {
210
- start: {
211
- line: 20,
212
- column: 6
213
- },
214
- end: {
215
- line: 22,
216
- column: 7
217
- }
218
- },
219
- type: 'if',
220
- locations: [{
221
- start: {
222
- line: 20,
223
- column: 6
224
- },
225
- end: {
226
- line: 22,
227
- column: 7
228
- }
229
- }, {
230
- start: {
231
- line: 20,
232
- column: 6
233
- },
234
- end: {
235
- line: 22,
236
- column: 7
237
- }
238
- }]
239
- },
240
- '1': {
241
- loc: {
242
- start: {
243
- line: 24,
244
- column: 6
245
- },
246
- end: {
247
- line: 26,
248
- column: 7
249
- }
250
- },
251
- type: 'if',
252
- locations: [{
253
- start: {
254
- line: 24,
255
- column: 6
256
- },
257
- end: {
258
- line: 26,
259
- column: 7
260
- }
261
- }, {
262
- start: {
263
- line: 24,
264
- column: 6
265
- },
266
- end: {
267
- line: 26,
268
- column: 7
269
- }
270
- }]
271
- }
272
- },
273
- s: {
274
- '0': 0,
275
- '1': 0,
276
- '2': 0,
277
- '3': 0,
278
- '4': 0,
279
- '5': 0,
280
- '6': 0,
281
- '7': 0,
282
- '8': 0,
283
- '9': 0,
284
- '10': 0,
285
- '11': 0
286
- },
287
- f: {
288
- '0': 0,
289
- '1': 0,
290
- '2': 0
291
- },
292
- b: {
293
- '0': [0, 0],
294
- '1': [0, 0]
295
- }
296
- },
297
- coverage = global[gcv] || (global[gcv] = {});
298
-
299
- if (coverage[path] && coverage[path].hash === hash) {
300
- return coverage[path];
301
- }
302
-
303
- coverageData.hash = hash;
304
- return coverage[path] = coverageData;
305
- }();
306
-
307
7
  var _lodash = require('lodash');
308
8
 
309
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -322,51 +22,28 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
322
22
  * @returns {number[]}
323
23
  */
324
24
  exports.default = (rows, config) => {
325
- ++cov_161lflitbr.f[0];
25
+ const tableWidth = rows[0].length;
326
26
 
327
- const tableWidth = (++cov_161lflitbr.s[0], rows[0].length);
27
+ const rowSpanIndex = [];
328
28
 
329
- const rowSpanIndex = (++cov_161lflitbr.s[1], []);
330
-
331
- ++cov_161lflitbr.s[2];
332
29
  _lodash2.default.forEach(rows, cells => {
333
- ++cov_161lflitbr.f[1];
334
-
335
- const cellHeightIndex = (++cov_161lflitbr.s[3], _lodash2.default.fill(Array(tableWidth), 1));
30
+ const cellHeightIndex = _lodash2.default.fill(Array(tableWidth), 1);
336
31
 
337
- ++cov_161lflitbr.s[4];
338
32
  _lodash2.default.forEach(cells, (value, index1) => {
339
- ++cov_161lflitbr.f[2];
340
- ++cov_161lflitbr.s[5];
341
-
342
33
  if (!_lodash2.default.isNumber(config.columns[index1].width)) {
343
- ++cov_161lflitbr.b[0][0];
344
- ++cov_161lflitbr.s[6];
345
-
346
34
  throw new Error('column[index].width must be a number.');
347
- } else {
348
- ++cov_161lflitbr.b[0][1];
349
35
  }
350
36
 
351
- ++cov_161lflitbr.s[7];
352
37
  if (!_lodash2.default.isBoolean(config.columns[index1].wrapWord)) {
353
- ++cov_161lflitbr.b[1][0];
354
- ++cov_161lflitbr.s[8];
355
-
356
38
  throw new Error('column[index].wrapWord must be a boolean.');
357
- } else {
358
- ++cov_161lflitbr.b[1][1];
359
39
  }
360
40
 
361
- ++cov_161lflitbr.s[9];
362
41
  cellHeightIndex[index1] = (0, _calculateCellHeight2.default)(value, config.columns[index1].width, config.columns[index1].wrapWord);
363
42
  });
364
43
 
365
- ++cov_161lflitbr.s[10];
366
44
  rowSpanIndex.push(_lodash2.default.max(cellHeightIndex));
367
45
  });
368
46
 
369
- ++cov_161lflitbr.s[11];
370
47
  return rowSpanIndex;
371
48
  };
372
49