table 3.8.2 → 4.0.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.
Files changed (56) hide show
  1. package/README.md +35 -16
  2. package/dist/alignString.js +19 -842
  3. package/dist/alignTableData.js +4 -226
  4. package/dist/calculateCellHeight.js +6 -343
  5. package/dist/calculateCellWidthIndex.js +2 -112
  6. package/dist/calculateMaximumColumnWidthIndex.js +5 -299
  7. package/dist/calculateRowHeightIndex.js +8 -333
  8. package/dist/createStream.js +19 -814
  9. package/dist/drawBorder.js +11 -292
  10. package/dist/drawRow.js +1 -69
  11. package/dist/drawTable.js +7 -474
  12. package/dist/getBorderCharacters.js +1 -315
  13. package/dist/index.js +4 -28
  14. package/dist/makeConfig.js +15 -544
  15. package/dist/makeStreamConfig.js +13 -587
  16. package/dist/mapDataUsingRowHeightIndex.js +9 -349
  17. package/dist/padTableData.js +5 -166
  18. package/dist/schemas/config.json +2 -2
  19. package/dist/schemas/streamConfig.json +2 -2
  20. package/dist/stringifyTableData.js +4 -116
  21. package/dist/table.js +5 -203
  22. package/dist/truncateTableData.js +3 -147
  23. package/dist/validateConfig.js +20 -23
  24. package/dist/validateStreamConfig.js +17 -19
  25. package/dist/validateTableData.js +11 -528
  26. package/dist/wrapString.js +3 -135
  27. package/dist/wrapWord.js +4 -257
  28. package/package.json +27 -24
  29. package/test/README/usage/basic.js +0 -25
  30. package/test/README/usage/cell_content_alignment.js +0 -45
  31. package/test/README/usage/column_width.js +0 -33
  32. package/test/README/usage/custom_border.js +0 -50
  33. package/test/README/usage/draw_horizontal_line.js +0 -41
  34. package/test/README/usage/expectTable.js +0 -13
  35. package/test/README/usage/moon_mission.js +0 -67
  36. package/test/README/usage/padding_cell_content.js +0 -39
  37. package/test/README/usage/predefined_border_templates.js +0 -91
  38. package/test/README/usage/streaming.js +0 -56
  39. package/test/README/usage/text_truncating.js +0 -32
  40. package/test/README/usage/text_wrapping.js +0 -67
  41. package/test/alignString.js +0 -102
  42. package/test/calculateCellHeight.js +0 -44
  43. package/test/calculateCellWidthIndex.js +0 -20
  44. package/test/calculateMaximumColumnWidthIndex.js +0 -59
  45. package/test/calculateRowHeightIndex.js +0 -78
  46. package/test/config.js +0 -43
  47. package/test/configSamples.js +0 -153
  48. package/test/createStream.js +0 -41
  49. package/test/drawBorder.js +0 -71
  50. package/test/makeConfig.js +0 -75
  51. package/test/mapDataUsingRowHeightIndex.js +0 -119
  52. package/test/streamConfig.js +0 -43
  53. package/test/streamConfigSamples.js +0 -151
  54. package/test/validateTableData.js +0 -65
  55. package/test/wrapString.js +0 -45
  56. package/test/wrapWord.js +0 -32
@@ -3,272 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = undefined;
7
-
8
- var cov_a6zw0ub9o = function () {
9
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/drawBorder.js',
10
- hash = '4e518697633f89fcc2ec65c54c9d288ff127a8f1',
11
- global = new Function('return this')(),
12
- gcv = '__coverage__',
13
- coverageData = {
14
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/drawBorder.js',
15
- statementMap: {
16
- '0': {
17
- start: {
18
- line: 16,
19
- column: 19
20
- },
21
- end: {
22
- line: 24,
23
- column: 1
24
- }
25
- },
26
- '1': {
27
- start: {
28
- line: 17,
29
- column: 18
30
- },
31
- end: {
32
- line: 21,
33
- column: 21
34
- }
35
- },
36
- '2': {
37
- start: {
38
- line: 19,
39
- column: 6
40
- },
41
- end: {
42
- line: 19,
43
- column: 40
44
- }
45
- },
46
- '3': {
47
- start: {
48
- line: 23,
49
- column: 2
50
- },
51
- end: {
52
- line: 23,
53
- column: 51
54
- }
55
- },
56
- '4': {
57
- start: {
58
- line: 39,
59
- column: 22
60
- },
61
- end: {
62
- line: 46,
63
- column: 1
64
- }
65
- },
66
- '5': {
67
- start: {
68
- line: 40,
69
- column: 2
70
- },
71
- end: {
72
- line: 45,
73
- column: 5
74
- }
75
- },
76
- '6': {
77
- start: {
78
- line: 61,
79
- column: 23
80
- },
81
- end: {
82
- line: 68,
83
- column: 1
84
- }
85
- },
86
- '7': {
87
- start: {
88
- line: 62,
89
- column: 2
90
- },
91
- end: {
92
- line: 67,
93
- column: 5
94
- }
95
- },
96
- '8': {
97
- start: {
98
- line: 83,
99
- column: 25
100
- },
101
- end: {
102
- line: 90,
103
- column: 1
104
- }
105
- },
106
- '9': {
107
- start: {
108
- line: 84,
109
- column: 2
110
- },
111
- end: {
112
- line: 89,
113
- column: 5
114
- }
115
- }
116
- },
117
- fnMap: {
118
- '0': {
119
- name: '(anonymous_0)',
120
- decl: {
121
- start: {
122
- line: 16,
123
- column: 19
124
- },
125
- end: {
126
- line: 16,
127
- column: 20
128
- }
129
- },
130
- loc: {
131
- start: {
132
- line: 16,
133
- column: 47
134
- },
135
- end: {
136
- line: 24,
137
- column: 1
138
- }
139
- }
140
- },
141
- '1': {
142
- name: '(anonymous_1)',
143
- decl: {
144
- start: {
145
- line: 18,
146
- column: 26
147
- },
148
- end: {
149
- line: 18,
150
- column: 27
151
- }
152
- },
153
- loc: {
154
- start: {
155
- line: 18,
156
- column: 36
157
- },
158
- end: {
159
- line: 20,
160
- column: 5
161
- }
162
- }
163
- },
164
- '2': {
165
- name: '(anonymous_2)',
166
- decl: {
167
- start: {
168
- line: 39,
169
- column: 22
170
- },
171
- end: {
172
- line: 39,
173
- column: 23
174
- }
175
- },
176
- loc: {
177
- start: {
178
- line: 39,
179
- column: 50
180
- },
181
- end: {
182
- line: 46,
183
- column: 1
184
- }
185
- }
186
- },
187
- '3': {
188
- name: '(anonymous_3)',
189
- decl: {
190
- start: {
191
- line: 61,
192
- column: 23
193
- },
194
- end: {
195
- line: 61,
196
- column: 24
197
- }
198
- },
199
- loc: {
200
- start: {
201
- line: 61,
202
- column: 51
203
- },
204
- end: {
205
- line: 68,
206
- column: 1
207
- }
208
- }
209
- },
210
- '4': {
211
- name: '(anonymous_4)',
212
- decl: {
213
- start: {
214
- line: 83,
215
- column: 25
216
- },
217
- end: {
218
- line: 83,
219
- column: 26
220
- }
221
- },
222
- loc: {
223
- start: {
224
- line: 83,
225
- column: 53
226
- },
227
- end: {
228
- line: 90,
229
- column: 1
230
- }
231
- }
232
- }
233
- },
234
- branchMap: {},
235
- s: {
236
- '0': 0,
237
- '1': 0,
238
- '2': 0,
239
- '3': 0,
240
- '4': 0,
241
- '5': 0,
242
- '6': 0,
243
- '7': 0,
244
- '8': 0,
245
- '9': 0
246
- },
247
- f: {
248
- '0': 0,
249
- '1': 0,
250
- '2': 0,
251
- '3': 0,
252
- '4': 0
253
- },
254
- b: {}
255
- },
256
- coverage = global[gcv] || (global[gcv] = {});
257
-
258
- if (coverage[path] && coverage[path].hash === hash) {
259
- return coverage[path];
260
- }
261
-
262
- coverageData.hash = hash;
263
- return coverage[path] = coverageData;
264
- }();
265
-
266
- var _lodash = require('lodash');
267
-
268
- var _lodash2 = _interopRequireDefault(_lodash);
269
-
270
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
271
-
272
6
  /**
273
7
  * @typedef drawBorder~parts
274
8
  * @property {string} left
@@ -282,19 +16,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
282
16
  * @param {drawBorder~parts} parts
283
17
  * @returns {string}
284
18
  */
285
- const drawBorder = (++cov_a6zw0ub9o.s[0], (columnSizeIndex, parts) => {
286
- ++cov_a6zw0ub9o.f[0];
287
-
288
- const columns = (++cov_a6zw0ub9o.s[1], _lodash2.default.map(columnSizeIndex, size => {
289
- ++cov_a6zw0ub9o.f[1];
290
- ++cov_a6zw0ub9o.s[2];
19
+ const drawBorder = (columnSizeIndex, parts) => {
20
+ const columns = columnSizeIndex.map(size => {
21
+ return parts.body.repeat(size);
22
+ }).join(parts.join);
291
23
 
292
- return _lodash2.default.repeat(parts.body, size);
293
- }).join(parts.join));
294
-
295
- ++cov_a6zw0ub9o.s[3];
296
24
  return parts.left + columns + parts.right + '\n';
297
- });
25
+ };
298
26
 
299
27
  /**
300
28
  * @typedef drawBorderTop~parts
@@ -309,17 +37,14 @@ const drawBorder = (++cov_a6zw0ub9o.s[0], (columnSizeIndex, parts) => {
309
37
  * @param {drawBorderTop~parts} parts
310
38
  * @returns {string}
311
39
  */
312
- const drawBorderTop = (++cov_a6zw0ub9o.s[4], (columnSizeIndex, parts) => {
313
- ++cov_a6zw0ub9o.f[2];
314
- ++cov_a6zw0ub9o.s[5];
315
-
40
+ const drawBorderTop = (columnSizeIndex, parts) => {
316
41
  return drawBorder(columnSizeIndex, {
317
42
  body: parts.topBody,
318
43
  join: parts.topJoin,
319
44
  left: parts.topLeft,
320
45
  right: parts.topRight
321
46
  });
322
- });
47
+ };
323
48
 
324
49
  /**
325
50
  * @typedef drawBorderJoin~parts
@@ -334,17 +59,14 @@ const drawBorderTop = (++cov_a6zw0ub9o.s[4], (columnSizeIndex, parts) => {
334
59
  * @param {drawBorderJoin~parts} parts
335
60
  * @returns {string}
336
61
  */
337
- const drawBorderJoin = (++cov_a6zw0ub9o.s[6], (columnSizeIndex, parts) => {
338
- ++cov_a6zw0ub9o.f[3];
339
- ++cov_a6zw0ub9o.s[7];
340
-
62
+ const drawBorderJoin = (columnSizeIndex, parts) => {
341
63
  return drawBorder(columnSizeIndex, {
342
64
  body: parts.joinBody,
343
65
  join: parts.joinJoin,
344
66
  left: parts.joinLeft,
345
67
  right: parts.joinRight
346
68
  });
347
- });
69
+ };
348
70
 
349
71
  /**
350
72
  * @typedef drawBorderBottom~parts
@@ -359,17 +81,14 @@ const drawBorderJoin = (++cov_a6zw0ub9o.s[6], (columnSizeIndex, parts) => {
359
81
  * @param {drawBorderBottom~parts} parts
360
82
  * @returns {string}
361
83
  */
362
- const drawBorderBottom = (++cov_a6zw0ub9o.s[8], (columnSizeIndex, parts) => {
363
- ++cov_a6zw0ub9o.f[4];
364
- ++cov_a6zw0ub9o.s[9];
365
-
84
+ const drawBorderBottom = (columnSizeIndex, parts) => {
366
85
  return drawBorder(columnSizeIndex, {
367
86
  body: parts.bottomBody,
368
87
  join: parts.bottomJoin,
369
88
  left: parts.bottomLeft,
370
89
  right: parts.bottomRight
371
90
  });
372
- });
91
+ };
373
92
 
374
93
  exports.drawBorder = drawBorder;
375
94
  exports.drawBorderBottom = drawBorderBottom;
package/dist/drawRow.js CHANGED
@@ -4,69 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var cov_htwvnqv09 = function () {
8
- var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/drawRow.js',
9
- hash = '0dd31170d58b254867e7d0076541ce12f723bd20',
10
- global = new Function('return this')(),
11
- gcv = '__coverage__',
12
- coverageData = {
13
- path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/drawRow.js',
14
- statementMap: {
15
- '0': {
16
- start: {
17
- line: 14,
18
- column: 2
19
- },
20
- end: {
21
- line: 14,
22
- column: 83
23
- }
24
- }
25
- },
26
- fnMap: {
27
- '0': {
28
- name: '(anonymous_0)',
29
- decl: {
30
- start: {
31
- line: 13,
32
- column: 15
33
- },
34
- end: {
35
- line: 13,
36
- column: 16
37
- }
38
- },
39
- loc: {
40
- start: {
41
- line: 13,
42
- column: 36
43
- },
44
- end: {
45
- line: 15,
46
- column: 1
47
- }
48
- }
49
- }
50
- },
51
- branchMap: {},
52
- s: {
53
- '0': 0
54
- },
55
- f: {
56
- '0': 0
57
- },
58
- b: {}
59
- },
60
- coverage = global[gcv] || (global[gcv] = {});
61
-
62
- if (coverage[path] && coverage[path].hash === hash) {
63
- return coverage[path];
64
- }
65
-
66
- coverageData.hash = hash;
67
- return coverage[path] = coverageData;
68
- }();
69
-
70
7
  /**
71
8
  * @typedef {Object} drawRow~border
72
9
  * @property {string} bodyLeft
@@ -80,10 +17,5 @@ var cov_htwvnqv09 = function () {
80
17
  * @returns {string}
81
18
  */
82
19
  exports.default = (columns, border) => {
83
- ++cov_htwvnqv09.f[0];
84
- ++cov_htwvnqv09.s[0];
85
-
86
20
  return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n';
87
- };
88
-
89
- module.exports = exports['default'];
21
+ };