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.
package/dist/table.js CHANGED
@@ -4,194 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_1y0c093qbd = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/table.js',
9
- hash = 'd4162e54a4a463a5103e2932efcc4187503c2876',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/table.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 77,
18
- column: 2
19
- },
20
- end: {
21
- line: 77,
22
- column: 26
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 79,
28
- column: 2
29
- },
30
- end: {
31
- line: 79,
32
- column: 34
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 81,
38
- column: 17
39
- },
40
- end: {
41
- line: 81,
42
- column: 45
43
- }
44
- },
45
- '3': {
46
- start: {
47
- line: 83,
48
- column: 2
49
- },
50
- end: {
51
- line: 83,
52
- column: 41
53
- }
54
- },
55
- '4': {
56
- start: {
57
- line: 85,
58
- column: 25
59
- },
60
- end: {
61
- line: 85,
62
- column: 62
63
- }
64
- },
65
- '5': {
66
- start: {
67
- line: 87,
68
- column: 2
69
- },
70
- end: {
71
- line: 87,
72
- column: 66
73
- }
74
- },
75
- '6': {
76
- start: {
77
- line: 88,
78
- column: 2
79
- },
80
- end: {
81
- line: 88,
82
- column: 38
83
- }
84
- },
85
- '7': {
86
- start: {
87
- line: 89,
88
- column: 2
89
- },
90
- end: {
91
- line: 89,
92
- column: 36
93
- }
94
- },
95
- '8': {
96
- start: {
97
- line: 91,
98
- column: 25
99
- },
100
- end: {
101
- line: 91,
102
- column: 57
103
- }
104
- },
105
- '9': {
106
- start: {
107
- line: 93,
108
- column: 2
109
- },
110
- end: {
111
- line: 93,
112
- column: 99
113
- }
114
- }
115
- },
116
- fnMap: {
117
- '0': {
118
- name: '(anonymous_0)',
119
- decl: {
120
- start: {
121
- line: 74,
122
- column: 15
123
- },
124
- end: {
125
- line: 74,
126
- column: 16
127
- }
128
- },
129
- loc: {
130
- start: {
131
- line: 74,
132
- column: 42
133
- },
134
- end: {
135
- line: 94,
136
- column: 1
137
- }
138
- }
139
- }
140
- },
141
- branchMap: {
142
- '0': {
143
- loc: {
144
- start: {
145
- line: 74,
146
- column: 22
147
- },
148
- end: {
149
- line: 74,
150
- column: 37
151
- }
152
- },
153
- type: 'default-arg',
154
- locations: [{
155
- start: {
156
- line: 74,
157
- column: 35
158
- },
159
- end: {
160
- line: 74,
161
- column: 37
162
- }
163
- }]
164
- }
165
- },
166
- s: {
167
- '0': 0,
168
- '1': 0,
169
- '2': 0,
170
- '3': 0,
171
- '4': 0,
172
- '5': 0,
173
- '6': 0,
174
- '7': 0,
175
- '8': 0,
176
- '9': 0
177
- },
178
- f: {
179
- '0': 0
180
- },
181
- b: {
182
- '0': [0]
183
- }
184
- },
185
- coverage = global[gcv] || (global[gcv] = {});
186
-
187
- if (coverage[path] && coverage[path].hash === hash) {
188
- return coverage[path];
189
- }
190
-
191
- coverageData.hash = hash;
192
- return coverage[path] = coverageData;
193
- }();
194
-
195
7
  var _drawTable = require('./drawTable');
196
8
 
197
9
  var _drawTable2 = _interopRequireDefault(_drawTable);
@@ -297,34 +109,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
297
109
  * @returns {string}
298
110
  */
299
111
  exports.default = function (data) {
300
- let userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (++cov_1y0c093qbd.b[0][0], {});
301
- ++cov_1y0c093qbd.f[0];
112
+ let userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
302
113
 
303
114
  let rows;
304
115
 
305
- ++cov_1y0c093qbd.s[0];
306
116
  (0, _validateTableData2.default)(data);
307
117
 
308
- ++cov_1y0c093qbd.s[1];
309
118
  rows = (0, _stringifyTableData2.default)(data);
310
119
 
311
- const config = (++cov_1y0c093qbd.s[2], (0, _makeConfig2.default)(rows, userConfig));
120
+ const config = (0, _makeConfig2.default)(rows, userConfig);
312
121
 
313
- ++cov_1y0c093qbd.s[3];
314
122
  rows = (0, _truncateTableData2.default)(data, config);
315
123
 
316
- const rowHeightIndex = (++cov_1y0c093qbd.s[4], (0, _calculateRowHeightIndex2.default)(rows, config));
124
+ const rowHeightIndex = (0, _calculateRowHeightIndex2.default)(rows, config);
317
125
 
318
- ++cov_1y0c093qbd.s[5];
319
126
  rows = (0, _mapDataUsingRowHeightIndex2.default)(rows, rowHeightIndex, config);
320
- ++cov_1y0c093qbd.s[6];
321
127
  rows = (0, _alignTableData2.default)(rows, config);
322
- ++cov_1y0c093qbd.s[7];
323
128
  rows = (0, _padTableData2.default)(rows, config);
324
129
 
325
- const cellWidthIndex = (++cov_1y0c093qbd.s[8], (0, _calculateCellWidthIndex2.default)(rows[0]));
130
+ const cellWidthIndex = (0, _calculateCellWidthIndex2.default)(rows[0]);
326
131
 
327
- ++cov_1y0c093qbd.s[9];
328
132
  return (0, _drawTable2.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine);
329
133
  };
330
134
 
@@ -4,139 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_2ah9qi3g32 = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/truncateTableData.js',
9
- hash = '206286e5f3c48d9bf4d4c90ecb0d671778434f3b',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/truncateTableData.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 10,
18
- column: 2
19
- },
20
- end: {
21
- line: 16,
22
- column: 5
23
- }
24
- },
25
- '1': {
26
- start: {
27
- line: 11,
28
- column: 4
29
- },
30
- end: {
31
- line: 15,
32
- column: 7
33
- }
34
- },
35
- '2': {
36
- start: {
37
- line: 12,
38
- column: 6
39
- },
40
- end: {
41
- line: 14,
42
- column: 9
43
- }
44
- }
45
- },
46
- fnMap: {
47
- '0': {
48
- name: '(anonymous_0)',
49
- decl: {
50
- start: {
51
- line: 9,
52
- column: 15
53
- },
54
- end: {
55
- line: 9,
56
- column: 16
57
- }
58
- },
59
- loc: {
60
- start: {
61
- line: 9,
62
- column: 33
63
- },
64
- end: {
65
- line: 17,
66
- column: 1
67
- }
68
- }
69
- },
70
- '1': {
71
- name: '(anonymous_1)',
72
- decl: {
73
- start: {
74
- line: 10,
75
- column: 21
76
- },
77
- end: {
78
- line: 10,
79
- column: 22
80
- }
81
- },
82
- loc: {
83
- start: {
84
- line: 10,
85
- column: 32
86
- },
87
- end: {
88
- line: 16,
89
- column: 3
90
- }
91
- }
92
- },
93
- '2': {
94
- name: '(anonymous_2)',
95
- decl: {
96
- start: {
97
- line: 11,
98
- column: 24
99
- },
100
- end: {
101
- line: 11,
102
- column: 25
103
- }
104
- },
105
- loc: {
106
- start: {
107
- line: 11,
108
- column: 44
109
- },
110
- end: {
111
- line: 15,
112
- column: 5
113
- }
114
- }
115
- }
116
- },
117
- branchMap: {},
118
- s: {
119
- '0': 0,
120
- '1': 0,
121
- '2': 0
122
- },
123
- f: {
124
- '0': 0,
125
- '1': 0,
126
- '2': 0
127
- },
128
- b: {}
129
- },
130
- coverage = global[gcv] || (global[gcv] = {});
131
-
132
- if (coverage[path] && coverage[path].hash === hash) {
133
- return coverage[path];
134
- }
135
-
136
- coverageData.hash = hash;
137
- return coverage[path] = coverageData;
138
- }();
139
-
140
7
  var _lodash = require('lodash');
141
8
 
142
9
  var _lodash2 = _interopRequireDefault(_lodash);
@@ -150,17 +17,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
150
17
  * @returns {table~row[]}
151
18
  */
152
19
  exports.default = (rows, config) => {
153
- ++cov_2ah9qi3g32.f[0];
154
- ++cov_2ah9qi3g32.s[0];
155
-
156
20
  return _lodash2.default.map(rows, cells => {
157
- ++cov_2ah9qi3g32.f[1];
158
- ++cov_2ah9qi3g32.s[1];
159
-
160
21
  return _lodash2.default.map(cells, (content, index) => {
161
- ++cov_2ah9qi3g32.f[2];
162
- ++cov_2ah9qi3g32.s[2];
163
-
164
22
  return _lodash2.default.truncate(content, {
165
23
  length: config.columns[index].truncate
166
24
  });