table 6.0.2 → 6.0.6

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 (50) hide show
  1. package/README.md +3 -2
  2. package/dist/alignString.js +7 -3
  3. package/dist/alignString.js.flow +4 -3
  4. package/dist/alignString.js.map +1 -1
  5. package/dist/alignTableData.js.map +1 -1
  6. package/dist/calculateCellHeight.js +3 -1
  7. package/dist/calculateCellHeight.js.flow +2 -1
  8. package/dist/calculateCellHeight.js.map +1 -1
  9. package/dist/calculateCellWidthIndex.js.map +1 -1
  10. package/dist/calculateMaximumColumnWidthIndex.js.map +1 -1
  11. package/dist/calculateRowHeightIndex.js +9 -3
  12. package/dist/calculateRowHeightIndex.js.flow +4 -3
  13. package/dist/calculateRowHeightIndex.js.map +1 -1
  14. package/dist/createStream.js +4 -2
  15. package/dist/createStream.js.flow +3 -2
  16. package/dist/createStream.js.map +1 -1
  17. package/dist/drawBorder.js.map +1 -1
  18. package/dist/drawRow.js.map +1 -1
  19. package/dist/drawTable.js.map +1 -1
  20. package/dist/getBorderCharacters.js.map +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/makeConfig.js +11 -15
  23. package/dist/makeConfig.js.flow +6 -5
  24. package/dist/makeConfig.js.map +1 -1
  25. package/dist/makeStreamConfig.js +11 -15
  26. package/dist/makeStreamConfig.js.flow +6 -7
  27. package/dist/makeStreamConfig.js.map +1 -1
  28. package/dist/mapDataUsingRowHeightIndex.js +7 -6
  29. package/dist/mapDataUsingRowHeightIndex.js.flow +3 -3
  30. package/dist/mapDataUsingRowHeightIndex.js.map +1 -1
  31. package/dist/padTableData.js.map +1 -1
  32. package/dist/schemas/config.json +4 -98
  33. package/dist/schemas/shared.json +98 -0
  34. package/dist/schemas/streamConfig.json +4 -98
  35. package/dist/stringifyTableData.js.map +1 -1
  36. package/dist/table.js.map +1 -1
  37. package/dist/truncateTableData.js +7 -6
  38. package/dist/truncateTableData.js.flow +4 -4
  39. package/dist/truncateTableData.js.map +1 -1
  40. package/dist/validateConfig.js +40 -751
  41. package/dist/validateConfig.js.flow +4 -10
  42. package/dist/validateConfig.js.map +1 -1
  43. package/dist/validateTableData.js +11 -39
  44. package/dist/validateTableData.js.map +1 -1
  45. package/dist/validators.js +1472 -0
  46. package/dist/wrapCell.js.map +1 -1
  47. package/dist/wrapString.js.map +1 -1
  48. package/dist/wrapWord.js.map +1 -1
  49. package/package.json +22 -19
  50. package/dist/validateStreamConfig.js +0 -741
@@ -1,741 +0,0 @@
1
- 'use strict';
2
- var equal = require('ajv/lib/compile/equal');
3
- var validate = (function() {
4
- var pattern0 = new RegExp('^[0-9]+$');
5
- var refVal = [];
6
- var refVal1 = (function() {
7
- var pattern0 = new RegExp('^[0-9]+$');
8
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
9
- 'use strict';
10
- var vErrors = null;
11
- var errors = 0;
12
- if (rootData === undefined) rootData = data;
13
- if ((data && typeof data === "object" && !Array.isArray(data))) {
14
- var errs__0 = errors;
15
- var valid1 = true;
16
- for (var key0 in data) {
17
- var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0));
18
- if (isAdditional0) {
19
- valid1 = false;
20
- var err = {
21
- keyword: 'additionalProperties',
22
- dataPath: (dataPath || '') + "",
23
- schemaPath: '#/additionalProperties',
24
- params: {
25
- additionalProperty: '' + key0 + ''
26
- },
27
- message: 'should NOT have additional properties'
28
- };
29
- if (vErrors === null) vErrors = [err];
30
- else vErrors.push(err);
31
- errors++;
32
- }
33
- }
34
- if (data.topBody !== undefined) {
35
- var errs_1 = errors;
36
- if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) {
37
- if (vErrors === null) vErrors = refVal2.errors;
38
- else vErrors = vErrors.concat(refVal2.errors);
39
- errors = vErrors.length;
40
- }
41
- var valid1 = errors === errs_1;
42
- }
43
- if (data.topJoin !== undefined) {
44
- var errs_1 = errors;
45
- if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) {
46
- if (vErrors === null) vErrors = refVal[2].errors;
47
- else vErrors = vErrors.concat(refVal[2].errors);
48
- errors = vErrors.length;
49
- }
50
- var valid1 = errors === errs_1;
51
- }
52
- if (data.topLeft !== undefined) {
53
- var errs_1 = errors;
54
- if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) {
55
- if (vErrors === null) vErrors = refVal[2].errors;
56
- else vErrors = vErrors.concat(refVal[2].errors);
57
- errors = vErrors.length;
58
- }
59
- var valid1 = errors === errs_1;
60
- }
61
- if (data.topRight !== undefined) {
62
- var errs_1 = errors;
63
- if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) {
64
- if (vErrors === null) vErrors = refVal[2].errors;
65
- else vErrors = vErrors.concat(refVal[2].errors);
66
- errors = vErrors.length;
67
- }
68
- var valid1 = errors === errs_1;
69
- }
70
- if (data.bottomBody !== undefined) {
71
- var errs_1 = errors;
72
- if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) {
73
- if (vErrors === null) vErrors = refVal[2].errors;
74
- else vErrors = vErrors.concat(refVal[2].errors);
75
- errors = vErrors.length;
76
- }
77
- var valid1 = errors === errs_1;
78
- }
79
- if (data.bottomJoin !== undefined) {
80
- var errs_1 = errors;
81
- if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) {
82
- if (vErrors === null) vErrors = refVal[2].errors;
83
- else vErrors = vErrors.concat(refVal[2].errors);
84
- errors = vErrors.length;
85
- }
86
- var valid1 = errors === errs_1;
87
- }
88
- if (data.bottomLeft !== undefined) {
89
- var errs_1 = errors;
90
- if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) {
91
- if (vErrors === null) vErrors = refVal[2].errors;
92
- else vErrors = vErrors.concat(refVal[2].errors);
93
- errors = vErrors.length;
94
- }
95
- var valid1 = errors === errs_1;
96
- }
97
- if (data.bottomRight !== undefined) {
98
- var errs_1 = errors;
99
- if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) {
100
- if (vErrors === null) vErrors = refVal[2].errors;
101
- else vErrors = vErrors.concat(refVal[2].errors);
102
- errors = vErrors.length;
103
- }
104
- var valid1 = errors === errs_1;
105
- }
106
- if (data.bodyLeft !== undefined) {
107
- var errs_1 = errors;
108
- if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) {
109
- if (vErrors === null) vErrors = refVal[2].errors;
110
- else vErrors = vErrors.concat(refVal[2].errors);
111
- errors = vErrors.length;
112
- }
113
- var valid1 = errors === errs_1;
114
- }
115
- if (data.bodyRight !== undefined) {
116
- var errs_1 = errors;
117
- if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) {
118
- if (vErrors === null) vErrors = refVal[2].errors;
119
- else vErrors = vErrors.concat(refVal[2].errors);
120
- errors = vErrors.length;
121
- }
122
- var valid1 = errors === errs_1;
123
- }
124
- if (data.bodyJoin !== undefined) {
125
- var errs_1 = errors;
126
- if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) {
127
- if (vErrors === null) vErrors = refVal[2].errors;
128
- else vErrors = vErrors.concat(refVal[2].errors);
129
- errors = vErrors.length;
130
- }
131
- var valid1 = errors === errs_1;
132
- }
133
- if (data.joinBody !== undefined) {
134
- var errs_1 = errors;
135
- if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) {
136
- if (vErrors === null) vErrors = refVal[2].errors;
137
- else vErrors = vErrors.concat(refVal[2].errors);
138
- errors = vErrors.length;
139
- }
140
- var valid1 = errors === errs_1;
141
- }
142
- if (data.joinLeft !== undefined) {
143
- var errs_1 = errors;
144
- if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) {
145
- if (vErrors === null) vErrors = refVal[2].errors;
146
- else vErrors = vErrors.concat(refVal[2].errors);
147
- errors = vErrors.length;
148
- }
149
- var valid1 = errors === errs_1;
150
- }
151
- if (data.joinRight !== undefined) {
152
- var errs_1 = errors;
153
- if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) {
154
- if (vErrors === null) vErrors = refVal[2].errors;
155
- else vErrors = vErrors.concat(refVal[2].errors);
156
- errors = vErrors.length;
157
- }
158
- var valid1 = errors === errs_1;
159
- }
160
- if (data.joinJoin !== undefined) {
161
- var errs_1 = errors;
162
- if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) {
163
- if (vErrors === null) vErrors = refVal[2].errors;
164
- else vErrors = vErrors.concat(refVal[2].errors);
165
- errors = vErrors.length;
166
- }
167
- var valid1 = errors === errs_1;
168
- }
169
- } else {
170
- var err = {
171
- keyword: 'type',
172
- dataPath: (dataPath || '') + "",
173
- schemaPath: '#/type',
174
- params: {
175
- type: 'object'
176
- },
177
- message: 'should be object'
178
- };
179
- if (vErrors === null) vErrors = [err];
180
- else vErrors.push(err);
181
- errors++;
182
- }
183
- validate.errors = vErrors;
184
- return errors === 0;
185
- };
186
- })();
187
- refVal1.schema = {
188
- "type": "object",
189
- "properties": {
190
- "topBody": {
191
- "$ref": "#/definitions/border"
192
- },
193
- "topJoin": {
194
- "$ref": "#/definitions/border"
195
- },
196
- "topLeft": {
197
- "$ref": "#/definitions/border"
198
- },
199
- "topRight": {
200
- "$ref": "#/definitions/border"
201
- },
202
- "bottomBody": {
203
- "$ref": "#/definitions/border"
204
- },
205
- "bottomJoin": {
206
- "$ref": "#/definitions/border"
207
- },
208
- "bottomLeft": {
209
- "$ref": "#/definitions/border"
210
- },
211
- "bottomRight": {
212
- "$ref": "#/definitions/border"
213
- },
214
- "bodyLeft": {
215
- "$ref": "#/definitions/border"
216
- },
217
- "bodyRight": {
218
- "$ref": "#/definitions/border"
219
- },
220
- "bodyJoin": {
221
- "$ref": "#/definitions/border"
222
- },
223
- "joinBody": {
224
- "$ref": "#/definitions/border"
225
- },
226
- "joinLeft": {
227
- "$ref": "#/definitions/border"
228
- },
229
- "joinRight": {
230
- "$ref": "#/definitions/border"
231
- },
232
- "joinJoin": {
233
- "$ref": "#/definitions/border"
234
- }
235
- },
236
- "additionalProperties": false
237
- };
238
- refVal1.errors = null;
239
- refVal[1] = refVal1;
240
- var refVal2 = (function() {
241
- var pattern0 = new RegExp('^[0-9]+$');
242
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
243
- 'use strict';
244
- var vErrors = null;
245
- var errors = 0;
246
- if (rootData === undefined) rootData = data;
247
- if (typeof data !== "string") {
248
- var err = {
249
- keyword: 'type',
250
- dataPath: (dataPath || '') + "",
251
- schemaPath: '#/type',
252
- params: {
253
- type: 'string'
254
- },
255
- message: 'should be string'
256
- };
257
- if (vErrors === null) vErrors = [err];
258
- else vErrors.push(err);
259
- errors++;
260
- }
261
- validate.errors = vErrors;
262
- return errors === 0;
263
- };
264
- })();
265
- refVal2.schema = {
266
- "type": "string"
267
- };
268
- refVal2.errors = null;
269
- refVal[2] = refVal2;
270
- var refVal3 = (function() {
271
- var pattern0 = new RegExp('^[0-9]+$');
272
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
273
- 'use strict';
274
- var vErrors = null;
275
- var errors = 0;
276
- if (rootData === undefined) rootData = data;
277
- if ((data && typeof data === "object" && !Array.isArray(data))) {
278
- var errs__0 = errors;
279
- var valid1 = true;
280
- for (var key0 in data) {
281
- var isAdditional0 = !(false || pattern0.test(key0));
282
- if (isAdditional0) {
283
- valid1 = false;
284
- var err = {
285
- keyword: 'additionalProperties',
286
- dataPath: (dataPath || '') + "",
287
- schemaPath: '#/additionalProperties',
288
- params: {
289
- additionalProperty: '' + key0 + ''
290
- },
291
- message: 'should NOT have additional properties'
292
- };
293
- if (vErrors === null) vErrors = [err];
294
- else vErrors.push(err);
295
- errors++;
296
- }
297
- }
298
- for (var key0 in data) {
299
- if (pattern0.test(key0)) {
300
- var errs_1 = errors;
301
- if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) {
302
- if (vErrors === null) vErrors = refVal4.errors;
303
- else vErrors = vErrors.concat(refVal4.errors);
304
- errors = vErrors.length;
305
- }
306
- var valid1 = errors === errs_1;
307
- }
308
- }
309
- } else {
310
- var err = {
311
- keyword: 'type',
312
- dataPath: (dataPath || '') + "",
313
- schemaPath: '#/type',
314
- params: {
315
- type: 'object'
316
- },
317
- message: 'should be object'
318
- };
319
- if (vErrors === null) vErrors = [err];
320
- else vErrors.push(err);
321
- errors++;
322
- }
323
- validate.errors = vErrors;
324
- return errors === 0;
325
- };
326
- })();
327
- refVal3.schema = {
328
- "type": "object",
329
- "patternProperties": {
330
- "^[0-9]+$": {
331
- "$ref": "#/definitions/column"
332
- }
333
- },
334
- "additionalProperties": false
335
- };
336
- refVal3.errors = null;
337
- refVal[3] = refVal3;
338
- var refVal4 = (function() {
339
- var pattern0 = new RegExp('^[0-9]+$');
340
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
341
- 'use strict';
342
- var vErrors = null;
343
- var errors = 0;
344
- if (rootData === undefined) rootData = data;
345
- if ((data && typeof data === "object" && !Array.isArray(data))) {
346
- var errs__0 = errors;
347
- var valid1 = true;
348
- for (var key0 in data) {
349
- var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight');
350
- if (isAdditional0) {
351
- valid1 = false;
352
- var err = {
353
- keyword: 'additionalProperties',
354
- dataPath: (dataPath || '') + "",
355
- schemaPath: '#/additionalProperties',
356
- params: {
357
- additionalProperty: '' + key0 + ''
358
- },
359
- message: 'should NOT have additional properties'
360
- };
361
- if (vErrors === null) vErrors = [err];
362
- else vErrors.push(err);
363
- errors++;
364
- }
365
- }
366
- var data1 = data.alignment;
367
- if (data1 !== undefined) {
368
- var errs_1 = errors;
369
- if (typeof data1 !== "string") {
370
- var err = {
371
- keyword: 'type',
372
- dataPath: (dataPath || '') + '.alignment',
373
- schemaPath: '#/properties/alignment/type',
374
- params: {
375
- type: 'string'
376
- },
377
- message: 'should be string'
378
- };
379
- if (vErrors === null) vErrors = [err];
380
- else vErrors.push(err);
381
- errors++;
382
- }
383
- var schema1 = validate.schema.properties.alignment.enum;
384
- var valid1;
385
- valid1 = false;
386
- for (var i1 = 0; i1 < schema1.length; i1++)
387
- if (equal(data1, schema1[i1])) {
388
- valid1 = true;
389
- break;
390
- } if (!valid1) {
391
- var err = {
392
- keyword: 'enum',
393
- dataPath: (dataPath || '') + '.alignment',
394
- schemaPath: '#/properties/alignment/enum',
395
- params: {
396
- allowedValues: schema1
397
- },
398
- message: 'should be equal to one of the allowed values'
399
- };
400
- if (vErrors === null) vErrors = [err];
401
- else vErrors.push(err);
402
- errors++;
403
- }
404
- var valid1 = errors === errs_1;
405
- }
406
- if (data.width !== undefined) {
407
- var errs_1 = errors;
408
- if ((typeof data.width !== "number")) {
409
- var err = {
410
- keyword: 'type',
411
- dataPath: (dataPath || '') + '.width',
412
- schemaPath: '#/properties/width/type',
413
- params: {
414
- type: 'number'
415
- },
416
- message: 'should be number'
417
- };
418
- if (vErrors === null) vErrors = [err];
419
- else vErrors.push(err);
420
- errors++;
421
- }
422
- var valid1 = errors === errs_1;
423
- }
424
- if (data.wrapWord !== undefined) {
425
- var errs_1 = errors;
426
- if (typeof data.wrapWord !== "boolean") {
427
- var err = {
428
- keyword: 'type',
429
- dataPath: (dataPath || '') + '.wrapWord',
430
- schemaPath: '#/properties/wrapWord/type',
431
- params: {
432
- type: 'boolean'
433
- },
434
- message: 'should be boolean'
435
- };
436
- if (vErrors === null) vErrors = [err];
437
- else vErrors.push(err);
438
- errors++;
439
- }
440
- var valid1 = errors === errs_1;
441
- }
442
- if (data.truncate !== undefined) {
443
- var errs_1 = errors;
444
- if ((typeof data.truncate !== "number")) {
445
- var err = {
446
- keyword: 'type',
447
- dataPath: (dataPath || '') + '.truncate',
448
- schemaPath: '#/properties/truncate/type',
449
- params: {
450
- type: 'number'
451
- },
452
- message: 'should be number'
453
- };
454
- if (vErrors === null) vErrors = [err];
455
- else vErrors.push(err);
456
- errors++;
457
- }
458
- var valid1 = errors === errs_1;
459
- }
460
- if (data.paddingLeft !== undefined) {
461
- var errs_1 = errors;
462
- if ((typeof data.paddingLeft !== "number")) {
463
- var err = {
464
- keyword: 'type',
465
- dataPath: (dataPath || '') + '.paddingLeft',
466
- schemaPath: '#/properties/paddingLeft/type',
467
- params: {
468
- type: 'number'
469
- },
470
- message: 'should be number'
471
- };
472
- if (vErrors === null) vErrors = [err];
473
- else vErrors.push(err);
474
- errors++;
475
- }
476
- var valid1 = errors === errs_1;
477
- }
478
- if (data.paddingRight !== undefined) {
479
- var errs_1 = errors;
480
- if ((typeof data.paddingRight !== "number")) {
481
- var err = {
482
- keyword: 'type',
483
- dataPath: (dataPath || '') + '.paddingRight',
484
- schemaPath: '#/properties/paddingRight/type',
485
- params: {
486
- type: 'number'
487
- },
488
- message: 'should be number'
489
- };
490
- if (vErrors === null) vErrors = [err];
491
- else vErrors.push(err);
492
- errors++;
493
- }
494
- var valid1 = errors === errs_1;
495
- }
496
- } else {
497
- var err = {
498
- keyword: 'type',
499
- dataPath: (dataPath || '') + "",
500
- schemaPath: '#/type',
501
- params: {
502
- type: 'object'
503
- },
504
- message: 'should be object'
505
- };
506
- if (vErrors === null) vErrors = [err];
507
- else vErrors.push(err);
508
- errors++;
509
- }
510
- validate.errors = vErrors;
511
- return errors === 0;
512
- };
513
- })();
514
- refVal4.schema = {
515
- "type": "object",
516
- "properties": {
517
- "alignment": {
518
- "type": "string",
519
- "enum": ["left", "right", "center"]
520
- },
521
- "width": {
522
- "type": "number"
523
- },
524
- "wrapWord": {
525
- "type": "boolean"
526
- },
527
- "truncate": {
528
- "type": "number"
529
- },
530
- "paddingLeft": {
531
- "type": "number"
532
- },
533
- "paddingRight": {
534
- "type": "number"
535
- }
536
- },
537
- "additionalProperties": false
538
- };
539
- refVal4.errors = null;
540
- refVal[4] = refVal4;
541
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
542
- 'use strict'; /*# sourceURL=streamConfig.json */
543
- var vErrors = null;
544
- var errors = 0;
545
- if (rootData === undefined) rootData = data;
546
- if ((data && typeof data === "object" && !Array.isArray(data))) {
547
- var errs__0 = errors;
548
- var valid1 = true;
549
- for (var key0 in data) {
550
- var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'columnCount');
551
- if (isAdditional0) {
552
- valid1 = false;
553
- var err = {
554
- keyword: 'additionalProperties',
555
- dataPath: (dataPath || '') + "",
556
- schemaPath: '#/additionalProperties',
557
- params: {
558
- additionalProperty: '' + key0 + ''
559
- },
560
- message: 'should NOT have additional properties'
561
- };
562
- if (vErrors === null) vErrors = [err];
563
- else vErrors.push(err);
564
- errors++;
565
- }
566
- }
567
- if (data.border !== undefined) {
568
- var errs_1 = errors;
569
- if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) {
570
- if (vErrors === null) vErrors = refVal1.errors;
571
- else vErrors = vErrors.concat(refVal1.errors);
572
- errors = vErrors.length;
573
- }
574
- var valid1 = errors === errs_1;
575
- }
576
- if (data.columns !== undefined) {
577
- var errs_1 = errors;
578
- if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) {
579
- if (vErrors === null) vErrors = refVal3.errors;
580
- else vErrors = vErrors.concat(refVal3.errors);
581
- errors = vErrors.length;
582
- }
583
- var valid1 = errors === errs_1;
584
- }
585
- if (data.columnDefault !== undefined) {
586
- var errs_1 = errors;
587
- if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) {
588
- if (vErrors === null) vErrors = refVal[4].errors;
589
- else vErrors = vErrors.concat(refVal[4].errors);
590
- errors = vErrors.length;
591
- }
592
- var valid1 = errors === errs_1;
593
- }
594
- if (data.columnCount !== undefined) {
595
- var errs_1 = errors;
596
- if ((typeof data.columnCount !== "number")) {
597
- var err = {
598
- keyword: 'type',
599
- dataPath: (dataPath || '') + '.columnCount',
600
- schemaPath: '#/properties/columnCount/type',
601
- params: {
602
- type: 'number'
603
- },
604
- message: 'should be number'
605
- };
606
- if (vErrors === null) vErrors = [err];
607
- else vErrors.push(err);
608
- errors++;
609
- }
610
- var valid1 = errors === errs_1;
611
- }
612
- } else {
613
- var err = {
614
- keyword: 'type',
615
- dataPath: (dataPath || '') + "",
616
- schemaPath: '#/type',
617
- params: {
618
- type: 'object'
619
- },
620
- message: 'should be object'
621
- };
622
- if (vErrors === null) vErrors = [err];
623
- else vErrors.push(err);
624
- errors++;
625
- }
626
- validate.errors = vErrors;
627
- return errors === 0;
628
- };
629
- })();
630
- validate.schema = {
631
- "$id": "streamConfig.json",
632
- "$schema": "http://json-schema.org/draft-07/schema#",
633
- "type": "object",
634
- "properties": {
635
- "border": {
636
- "$ref": "#/definitions/borders"
637
- },
638
- "columns": {
639
- "$ref": "#/definitions/columns"
640
- },
641
- "columnDefault": {
642
- "$ref": "#/definitions/column"
643
- },
644
- "columnCount": {
645
- "type": "number"
646
- }
647
- },
648
- "additionalProperties": false,
649
- "definitions": {
650
- "columns": {
651
- "type": "object",
652
- "patternProperties": {
653
- "^[0-9]+$": {
654
- "$ref": "#/definitions/column"
655
- }
656
- },
657
- "additionalProperties": false
658
- },
659
- "column": {
660
- "type": "object",
661
- "properties": {
662
- "alignment": {
663
- "type": "string",
664
- "enum": ["left", "right", "center"]
665
- },
666
- "width": {
667
- "type": "number"
668
- },
669
- "wrapWord": {
670
- "type": "boolean"
671
- },
672
- "truncate": {
673
- "type": "number"
674
- },
675
- "paddingLeft": {
676
- "type": "number"
677
- },
678
- "paddingRight": {
679
- "type": "number"
680
- }
681
- },
682
- "additionalProperties": false
683
- },
684
- "borders": {
685
- "type": "object",
686
- "properties": {
687
- "topBody": {
688
- "$ref": "#/definitions/border"
689
- },
690
- "topJoin": {
691
- "$ref": "#/definitions/border"
692
- },
693
- "topLeft": {
694
- "$ref": "#/definitions/border"
695
- },
696
- "topRight": {
697
- "$ref": "#/definitions/border"
698
- },
699
- "bottomBody": {
700
- "$ref": "#/definitions/border"
701
- },
702
- "bottomJoin": {
703
- "$ref": "#/definitions/border"
704
- },
705
- "bottomLeft": {
706
- "$ref": "#/definitions/border"
707
- },
708
- "bottomRight": {
709
- "$ref": "#/definitions/border"
710
- },
711
- "bodyLeft": {
712
- "$ref": "#/definitions/border"
713
- },
714
- "bodyRight": {
715
- "$ref": "#/definitions/border"
716
- },
717
- "bodyJoin": {
718
- "$ref": "#/definitions/border"
719
- },
720
- "joinBody": {
721
- "$ref": "#/definitions/border"
722
- },
723
- "joinLeft": {
724
- "$ref": "#/definitions/border"
725
- },
726
- "joinRight": {
727
- "$ref": "#/definitions/border"
728
- },
729
- "joinJoin": {
730
- "$ref": "#/definitions/border"
731
- }
732
- },
733
- "additionalProperties": false
734
- },
735
- "border": {
736
- "type": "string"
737
- }
738
- }
739
- };
740
- validate.errors = null;
741
- module.exports = validate;