table 6.3.0 → 6.3.4
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/alignString.d.ts +7 -0
- package/dist/{src/alignString.js → alignString.js} +2 -16
- package/dist/alignTableData.d.ts +3 -0
- package/dist/{src/alignTableData.js → alignTableData.js} +0 -1
- package/dist/calculateCellHeight.d.ts +2 -0
- package/dist/{src/calculateCellHeight.js → calculateCellHeight.js} +1 -3
- package/dist/calculateCellWidthIndex.d.ts +6 -0
- package/dist/{src/calculateCellWidthIndex.js → calculateCellWidthIndex.js} +0 -1
- package/dist/calculateMaximumColumnWidthIndex.d.ts +6 -0
- package/dist/{src/calculateMaximumColumnWidthIndex.js → calculateMaximumColumnWidthIndex.js} +0 -1
- package/dist/calculateRowHeightIndex.d.ts +6 -0
- package/dist/{src/calculateRowHeightIndex.js → calculateRowHeightIndex.js} +1 -7
- package/dist/createStream.d.ts +3 -0
- package/dist/{src/createStream.js → createStream.js} +0 -1
- package/dist/drawBorder.d.ts +25 -0
- package/dist/{src/drawBorder.js → drawBorder.js} +0 -1
- package/dist/drawHorizontalContent.d.ts +11 -0
- package/dist/{src/drawHorizontalContent.js → drawHorizontalContent.js} +0 -1
- package/dist/drawRow.d.ts +7 -0
- package/dist/{src/drawRow.js → drawRow.js} +0 -1
- package/dist/drawTable.d.ts +3 -0
- package/dist/{src/drawTable.js → drawTable.js} +0 -1
- package/dist/generated/validators.d.ts +13 -0
- package/dist/{src → generated}/validators.js +309 -315
- package/dist/getBorderCharacters.d.ts +3 -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/makeConfig.d.ts +8 -0
- package/dist/{src/makeConfig.js → makeConfig.js} +0 -1
- package/dist/makeStreamConfig.d.ts +8 -0
- package/dist/{src/makeStreamConfig.js → makeStreamConfig.js} +0 -1
- package/dist/mapDataUsingRowHeightIndex.d.ts +3 -0
- package/dist/{src/mapDataUsingRowHeightIndex.js → mapDataUsingRowHeightIndex.js} +0 -1
- package/dist/padTableData.d.ts +3 -0
- package/dist/{src/padTableData.js → padTableData.js} +0 -1
- package/dist/stringifyTableData.d.ts +3 -0
- package/dist/{src/stringifyTableData.js → stringifyTableData.js} +0 -1
- package/dist/table.d.ts +3 -0
- package/dist/{src/table.js → table.js} +0 -1
- package/dist/truncateTableData.d.ts +6 -0
- package/dist/{src/truncateTableData.js → truncateTableData.js} +0 -1
- package/dist/{src/types → types}/api.d.ts +1 -0
- package/dist/{src/types → types}/api.js +0 -1
- package/dist/types/internal.d.ts +1 -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/validateTableData.d.ts +2 -0
- package/dist/{src/validateTableData.js → validateTableData.js} +0 -1
- package/dist/wrapCell.d.ts +9 -0
- package/dist/{src/wrapCell.js → wrapCell.js} +0 -1
- package/dist/wrapString.d.ts +10 -0
- package/dist/{src/wrapString.js → wrapString.js} +0 -1
- package/dist/wrapWord.d.ts +2 -0
- package/dist/{src/wrapWord.js → wrapWord.js} +0 -1
- package/package.json +10 -15
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TableUserConfig } from './types/api';
|
|
2
|
+
import type { Row, TableConfig } from './types/internal';
|
|
3
|
+
declare const _default: (rows: Row[], userConfig?: TableUserConfig) => TableConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Makes a new configuration object out of the userConfig object
|
|
6
|
+
* using default values for the missing configuration properties.
|
|
7
|
+
*/
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StreamUserConfig } from './types/api';
|
|
2
|
+
import type { StreamConfig } from './types/internal';
|
|
3
|
+
declare const _default: (userConfig: StreamUserConfig) => StreamConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Makes a new configuration object out of the userConfig object
|
|
6
|
+
* using default values for the missing configuration properties.
|
|
7
|
+
*/
|
|
8
|
+
export default _default;
|
package/dist/table.d.ts
ADDED
|
@@ -18,6 +18,7 @@ export declare type BorderUserConfig = {
|
|
|
18
18
|
readonly joinBody?: string;
|
|
19
19
|
readonly joinJoin?: string;
|
|
20
20
|
};
|
|
21
|
+
export declare type BorderConfig = Required<BorderUserConfig>;
|
|
21
22
|
export declare type ColumnUserConfig = {
|
|
22
23
|
/**
|
|
23
24
|
* Cell content horizontal alignment (default: left)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,13 +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
|
-
|
|
7
|
-
// @ts-expect-error
|
|
8
|
-
// eslint-disable-next-line import/no-unresolved
|
|
9
|
-
const validators_1 = __importDefault(require("./validators"));
|
|
6
|
+
const validators_1 = __importDefault(require("./generated/validators"));
|
|
10
7
|
exports.default = (schemaId, config) => {
|
|
11
8
|
const validate = validators_1.default[schemaId];
|
|
12
|
-
if (!validate(config)) {
|
|
9
|
+
if (!validate(config) && validate.errors) {
|
|
13
10
|
const errors = validate.errors.map((error) => {
|
|
14
11
|
return {
|
|
15
12
|
message: error.message,
|
|
@@ -24,4 +21,3 @@ exports.default = (schemaId, config) => {
|
|
|
24
21
|
throw new Error('Invalid config.');
|
|
25
22
|
}
|
|
26
23
|
};
|
|
27
|
-
//# sourceMappingURL=validateConfig.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: (cellValue: string, columnWidth: number, useWrapWord: boolean) => string[];
|
|
2
|
+
/**
|
|
3
|
+
* Wrap a single cell value into a list of lines
|
|
4
|
+
*
|
|
5
|
+
* Always wraps on newlines, for the remainder uses either word or string wrapping
|
|
6
|
+
* depending on user configuration.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: (subject: string, size: number) => string[];
|
|
2
|
+
/**
|
|
3
|
+
* Creates an array of strings split into groups the length of size.
|
|
4
|
+
* This function works with strings that contain ASCII characters.
|
|
5
|
+
*
|
|
6
|
+
* wrapText is different from would-be "chunk" implementation
|
|
7
|
+
* in that whitespace characters that occur on a chunk size limit are trimmed.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"ajv": "^8.0.1",
|
|
9
|
-
"is-boolean-object": "^1.1.0",
|
|
10
|
-
"is-number-object": "^1.0.4",
|
|
11
|
-
"is-string": "^1.0.5",
|
|
12
9
|
"lodash.clonedeep": "^4.5.0",
|
|
13
10
|
"lodash.flatten": "^4.4.0",
|
|
14
11
|
"lodash.truncate": "^4.4.2",
|
|
@@ -37,13 +34,12 @@
|
|
|
37
34
|
"husky": "^4.3.6",
|
|
38
35
|
"js-beautify": "^1.13.0",
|
|
39
36
|
"lodash.mapvalues": "^4.6.0",
|
|
40
|
-
"lodash.random": "^3.2.0",
|
|
41
|
-
"lodash.sample": "^4.2.1",
|
|
42
37
|
"mkdirp": "^1.0.4",
|
|
43
38
|
"mocha": "^8.2.1",
|
|
44
39
|
"nyc": "^15.1.0",
|
|
45
40
|
"semantic-release": "^17.3.1",
|
|
46
41
|
"sinon": "^9.2.2",
|
|
42
|
+
"ts-node": "^9.1.1",
|
|
47
43
|
"typescript": "4.2.4"
|
|
48
44
|
},
|
|
49
45
|
"engines": {
|
|
@@ -63,11 +59,10 @@
|
|
|
63
59
|
"ansi"
|
|
64
60
|
],
|
|
65
61
|
"license": "BSD-3-Clause",
|
|
66
|
-
"main": "./dist/
|
|
62
|
+
"main": "./dist/index.js",
|
|
67
63
|
"files": [
|
|
68
|
-
"dist
|
|
69
|
-
"dist
|
|
70
|
-
"dist/src/index.d.ts"
|
|
64
|
+
"dist/**/*.js",
|
|
65
|
+
"dist/**/*.d.ts"
|
|
71
66
|
],
|
|
72
67
|
"name": "table",
|
|
73
68
|
"nyc": {
|
|
@@ -75,7 +70,7 @@
|
|
|
75
70
|
".ts"
|
|
76
71
|
],
|
|
77
72
|
"exclude": [
|
|
78
|
-
"
|
|
73
|
+
"src/generated/validators.js",
|
|
79
74
|
"test/**/*.ts"
|
|
80
75
|
],
|
|
81
76
|
"reporter": [
|
|
@@ -88,12 +83,12 @@
|
|
|
88
83
|
},
|
|
89
84
|
"scripts": {
|
|
90
85
|
"compile": "tsc",
|
|
91
|
-
"prebuild": "rm -fr ./dist && mkdirp dist
|
|
86
|
+
"prebuild": "rm -fr ./dist && mkdirp dist",
|
|
92
87
|
"build": "npm run create-validators && npm run compile",
|
|
93
88
|
"create-readme": "gitdown ./.README/README.md --output-file ./README.md",
|
|
94
|
-
"create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify >
|
|
95
|
-
"lint": "eslint ./src ./test",
|
|
96
|
-
"test": "mocha ./
|
|
89
|
+
"create-validators": "rm -fr ./src/generated && mkdirp ./src/generated && ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > ./src/generated/validators.js",
|
|
90
|
+
"lint": "eslint --ignore-path .gitignore ./src ./test",
|
|
91
|
+
"test": "npm run create-validators && mocha --require ts-node/register ./test/**/*.ts"
|
|
97
92
|
},
|
|
98
|
-
"version": "6.3.
|
|
93
|
+
"version": "6.3.4"
|
|
99
94
|
}
|