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