tty-table 4.1.3 → 4.1.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.
- package/package.json +6 -6
- package/src/factory.d.ts +1 -1
- package/src/format.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tty-table",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6",
|
|
4
4
|
"description": "Node cli table",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"types": "src/factory.d.ts",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/tecfu/tty-table",
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"chalk": "^
|
|
57
|
-
"csv": "^5.
|
|
58
|
-
"kleur": "^
|
|
59
|
-
"smartwrap": "^2.0.
|
|
56
|
+
"chalk": "^4.1.2",
|
|
57
|
+
"csv": "^5.5.0",
|
|
58
|
+
"kleur": "^4.1.4",
|
|
59
|
+
"smartwrap": "^2.0.2",
|
|
60
60
|
"strip-ansi": "^6.0.0",
|
|
61
61
|
"wcwidth": "^1.0.1",
|
|
62
|
-
"yargs": "^
|
|
62
|
+
"yargs": "^17.1.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@rollup/plugin-commonjs": "^11.0.2",
|
package/src/factory.d.ts
CHANGED
package/src/format.js
CHANGED
|
@@ -266,8 +266,7 @@ module.exports.getColumnWidths = (config, rows) => {
|
|
|
266
266
|
if (totalWidth > availableWidth || config.FIXED_WIDTH) {
|
|
267
267
|
// proportion wont be exact fit, but this method keeps us safe
|
|
268
268
|
const proportion = (availableWidth / totalWidth).toFixed(2) - 0.01
|
|
269
|
-
const relativeWidths = widths.map(value => Math.floor(proportion * value))
|
|
270
|
-
|
|
269
|
+
const relativeWidths = widths.map(value => Math.max(2, Math.floor(proportion * value)))
|
|
271
270
|
if (config.FIXED_WIDTH) return relativeWidths
|
|
272
271
|
|
|
273
272
|
// when proportion < 0 column cant be resized and totalWidth must overflow viewport
|