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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tty-table",
3
- "version": "4.1.3",
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": "^3.0.0",
57
- "csv": "^5.3.2",
58
- "kleur": "^3.0.3",
59
- "smartwrap": "^2.0.1",
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": "^15.3.1"
62
+ "yargs": "^17.1.1"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@rollup/plugin-commonjs": "^11.0.2",
package/src/factory.d.ts CHANGED
@@ -18,7 +18,7 @@ declare namespace TtyTable {
18
18
  color?: string;
19
19
  footerAlign?: string;
20
20
  footerColor?: string;
21
- formatter: Formatter;
21
+ formatter?: Formatter;
22
22
  headerAlign?: string;
23
23
  headerColor?: string;
24
24
  marginLeft?: number;
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