table 6.3.1 → 6.4.0
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/{src/alignString.d.ts → alignString.d.ts} +2 -1
- package/dist/{src/alignString.js → alignString.js} +1 -18
- package/dist/{src/alignTableData.d.ts → alignTableData.d.ts} +0 -0
- package/dist/{src/alignTableData.js → alignTableData.js} +0 -1
- package/dist/{src/calculateCellHeight.d.ts → calculateCellHeight.d.ts} +0 -0
- package/dist/{src/calculateCellHeight.js → calculateCellHeight.js} +1 -6
- package/dist/{src/calculateCellWidthIndex.d.ts → calculateCellWidthIndex.d.ts} +0 -0
- package/dist/{src/calculateCellWidthIndex.js → calculateCellWidthIndex.js} +0 -1
- package/dist/{src/calculateMaximumColumnWidthIndex.d.ts → calculateMaximumColumnWidthIndex.d.ts} +0 -0
- package/dist/{src/calculateMaximumColumnWidthIndex.js → calculateMaximumColumnWidthIndex.js} +0 -1
- package/dist/{src/calculateRowHeightIndex.d.ts → calculateRowHeightIndex.d.ts} +0 -0
- package/dist/{src/calculateRowHeightIndex.js → calculateRowHeightIndex.js} +0 -9
- package/dist/{src/createStream.d.ts → createStream.d.ts} +0 -0
- package/dist/{src/createStream.js → createStream.js} +0 -1
- package/dist/{src/drawBorder.d.ts → drawBorder.d.ts} +0 -0
- package/dist/{src/drawBorder.js → drawBorder.js} +0 -1
- package/dist/{src/drawHorizontalContent.d.ts → drawHorizontalContent.d.ts} +0 -0
- package/dist/{src/drawHorizontalContent.js → drawHorizontalContent.js} +0 -1
- package/dist/{src/drawRow.d.ts → drawRow.d.ts} +0 -0
- package/dist/{src/drawRow.js → drawRow.js} +0 -1
- package/dist/{src/drawTable.d.ts → drawTable.d.ts} +0 -0
- package/dist/{src/drawTable.js → drawTable.js} +0 -1
- package/dist/generated/validators.d.ts +13 -0
- package/dist/{src → generated}/validators.js +685 -398
- package/dist/{src/getBorderCharacters.d.ts → getBorderCharacters.d.ts} +0 -0
- package/dist/{src/getBorderCharacters.js → getBorderCharacters.js} +0 -1
- package/dist/{src/index.d.ts → index.d.ts} +0 -0
- package/dist/{src/index.js → index.js} +0 -1
- package/dist/{src/makeConfig.d.ts → makeConfig.d.ts} +0 -0
- package/dist/{src/makeConfig.js → makeConfig.js} +0 -1
- package/dist/{src/makeStreamConfig.d.ts → makeStreamConfig.d.ts} +0 -0
- package/dist/{src/makeStreamConfig.js → makeStreamConfig.js} +0 -1
- package/dist/{src/mapDataUsingRowHeightIndex.d.ts → mapDataUsingRowHeightIndex.d.ts} +0 -0
- package/dist/{src/mapDataUsingRowHeightIndex.js → mapDataUsingRowHeightIndex.js} +0 -1
- package/dist/{src/padTableData.d.ts → padTableData.d.ts} +0 -0
- package/dist/{src/padTableData.js → padTableData.js} +0 -1
- package/dist/{src/stringifyTableData.d.ts → stringifyTableData.d.ts} +0 -0
- package/dist/{src/stringifyTableData.js → stringifyTableData.js} +0 -1
- package/dist/{src/table.d.ts → table.d.ts} +0 -0
- package/dist/{src/table.js → table.js} +0 -1
- package/dist/{src/truncateTableData.d.ts → truncateTableData.d.ts} +0 -0
- package/dist/{src/truncateTableData.js → truncateTableData.js} +0 -1
- package/dist/{src/types → types}/api.d.ts +0 -0
- package/dist/{src/types → types}/api.js +0 -1
- package/dist/{src/types → types}/internal.d.ts +0 -0
- package/dist/{src/types → types}/internal.js +0 -1
- package/dist/validateConfig.d.ts +3 -0
- package/dist/{src/validateConfig.js → validateConfig.js} +2 -6
- package/dist/{src/validateTableData.d.ts → validateTableData.d.ts} +0 -0
- package/dist/{src/validateTableData.js → validateTableData.js} +0 -1
- package/dist/{src/wrapCell.d.ts → wrapCell.d.ts} +0 -0
- package/dist/{src/wrapCell.js → wrapCell.js} +0 -1
- package/dist/{src/wrapString.d.ts → wrapString.d.ts} +0 -0
- package/dist/{src/wrapString.js → wrapString.js} +0 -1
- package/dist/{src/wrapWord.d.ts → wrapWord.d.ts} +0 -0
- package/dist/{src/wrapWord.js → wrapWord.js} +0 -1
- package/package.json +10 -14
- package/dist/src/validateConfig.d.ts +0 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ColumnUserConfig } from './types/api';
|
|
2
|
+
declare const _default: (subject: string, containerWidth: number, alignment: ColumnUserConfig['alignment']) => string;
|
|
2
3
|
/**
|
|
3
4
|
* Pads a string to the left and/or right to position the subject
|
|
4
5
|
* text in a desired alignment within a container.
|
|
@@ -3,8 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const is_number_object_1 = __importDefault(require("is-number-object"));
|
|
7
|
-
const is_string_1 = __importDefault(require("is-string"));
|
|
8
6
|
const string_width_1 = __importDefault(require("string-width"));
|
|
9
7
|
const alignLeft = (subject, width) => {
|
|
10
8
|
return subject + ' '.repeat(width);
|
|
@@ -23,32 +21,18 @@ const alignCenter = (subject, width) => {
|
|
|
23
21
|
return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
|
-
const alignments = [
|
|
27
|
-
'left',
|
|
28
|
-
'right',
|
|
29
|
-
'center',
|
|
30
|
-
];
|
|
31
24
|
/**
|
|
32
25
|
* Pads a string to the left and/or right to position the subject
|
|
33
26
|
* text in a desired alignment within a container.
|
|
34
27
|
*/
|
|
35
28
|
exports.default = (subject, containerWidth, alignment) => {
|
|
36
|
-
if (
|
|
29
|
+
if (typeof subject !== 'string') {
|
|
37
30
|
throw new TypeError('Subject parameter value must be a string.');
|
|
38
31
|
}
|
|
39
|
-
if (!is_number_object_1.default(containerWidth)) {
|
|
40
|
-
throw new TypeError('Container width parameter value must be a number.');
|
|
41
|
-
}
|
|
42
32
|
const subjectWidth = string_width_1.default(subject);
|
|
43
33
|
if (subjectWidth > containerWidth) {
|
|
44
34
|
throw new Error('Subject parameter value width cannot be greater than the container width.');
|
|
45
35
|
}
|
|
46
|
-
if (!is_string_1.default(alignment)) {
|
|
47
|
-
throw new TypeError('Alignment parameter value must be a string.');
|
|
48
|
-
}
|
|
49
|
-
if (!alignments.includes(alignment)) {
|
|
50
|
-
throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');
|
|
51
|
-
}
|
|
52
36
|
if (subjectWidth === 0) {
|
|
53
37
|
return ' '.repeat(containerWidth);
|
|
54
38
|
}
|
|
@@ -61,4 +45,3 @@ exports.default = (subject, containerWidth, alignment) => {
|
|
|
61
45
|
}
|
|
62
46
|
return alignCenter(subject, availableWidth);
|
|
63
47
|
};
|
|
64
|
-
//# sourceMappingURL=alignString.js.map
|
|
File without changes
|
|
File without changes
|
|
@@ -3,15 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const is_string_1 = __importDefault(require("is-string"));
|
|
7
6
|
const wrapCell_1 = __importDefault(require("./wrapCell"));
|
|
8
7
|
exports.default = (value, columnWidth, useWrapWord = false) => {
|
|
9
|
-
if (
|
|
8
|
+
if (typeof value !== 'string') {
|
|
10
9
|
throw new TypeError('Value must be a string.');
|
|
11
10
|
}
|
|
12
|
-
if (!Number.isInteger(columnWidth) || columnWidth < 1) {
|
|
13
|
-
throw new TypeError('Column width must be an integer greater than 0.');
|
|
14
|
-
}
|
|
15
11
|
return wrapCell_1.default(value, columnWidth, useWrapWord).length;
|
|
16
12
|
};
|
|
17
|
-
//# sourceMappingURL=calculateCellHeight.js.map
|
|
File without changes
|
package/dist/{src/calculateMaximumColumnWidthIndex.d.ts → calculateMaximumColumnWidthIndex.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -3,8 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const is_boolean_object_1 = __importDefault(require("is-boolean-object"));
|
|
7
|
-
const is_number_object_1 = __importDefault(require("is-number-object"));
|
|
8
6
|
const calculateCellHeight_1 = __importDefault(require("./calculateCellHeight"));
|
|
9
7
|
/**
|
|
10
8
|
* Calculates the vertical row span index.
|
|
@@ -15,16 +13,9 @@ exports.default = (rows, config) => {
|
|
|
15
13
|
rows.forEach((cells) => {
|
|
16
14
|
const cellHeightIndex = new Array(tableWidth).fill(1);
|
|
17
15
|
cells.forEach((value, index1) => {
|
|
18
|
-
if (!is_number_object_1.default(config.columns[index1].width)) {
|
|
19
|
-
throw new TypeError('column[index].width must be a number.');
|
|
20
|
-
}
|
|
21
|
-
if (!is_boolean_object_1.default(config.columns[index1].wrapWord)) {
|
|
22
|
-
throw new TypeError('column[index].wrapWord must be a boolean.');
|
|
23
|
-
}
|
|
24
16
|
cellHeightIndex[index1] = calculateCellHeight_1.default(value, config.columns[index1].width, config.columns[index1].wrapWord);
|
|
25
17
|
});
|
|
26
18
|
rowSpanIndex.push(Math.max(...cellHeightIndex));
|
|
27
19
|
});
|
|
28
20
|
return rowSpanIndex;
|
|
29
21
|
};
|
|
30
|
-
//# sourceMappingURL=calculateRowHeightIndex.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function validate43(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
|
|
2
|
+
instancePath?: string | undefined;
|
|
3
|
+
parentData: any;
|
|
4
|
+
parentDataProperty: any;
|
|
5
|
+
rootData?: any;
|
|
6
|
+
}): boolean;
|
|
7
|
+
declare function validate70(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
|
|
8
|
+
instancePath?: string | undefined;
|
|
9
|
+
parentData: any;
|
|
10
|
+
parentDataProperty: any;
|
|
11
|
+
rootData?: any;
|
|
12
|
+
}): boolean;
|
|
13
|
+
export { validate43 as _config_json, validate70 as _streamConfig_json };
|