@oclif/table 0.4.5 → 0.4.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/lib/table.js CHANGED
@@ -16,7 +16,7 @@ import { allKeysInCollection, determineConfiguredWidth, determineWidthOfWrappedT
16
16
  */
17
17
  function determineWidthToUse(columns, maxWidth, width) {
18
18
  const tableWidth = columns.map((c) => c.width).reduce((a, b) => a + b, 0) + columns.length + 1;
19
- return width ?? Math.max(tableWidth, maxWidth);
19
+ return width ?? (tableWidth < maxWidth ? maxWidth : tableWidth);
20
20
  }
21
21
  function determineTruncatePosition(overflow) {
22
22
  switch (overflow) {
package/lib/utils.js CHANGED
@@ -111,7 +111,7 @@ export function getColumns(config, headings) {
111
111
  break;
112
112
  const minWidth = calcMinWidth(largestColumn);
113
113
  const difference = tableWidth - maxWidth;
114
- const newWidth = Math.max(largestColumn.width - difference, minWidth);
114
+ const newWidth = largestColumn.width - difference < minWidth ? minWidth : largestColumn.width - difference;
115
115
  largestColumn.width = newWidth;
116
116
  tableWidth = calculateTableWidth(widths);
117
117
  seen.add(largestColumn.key);
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@oclif/table",
3
3
  "description": "Display table in terminal",
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/table/issues",
7
7
  "dependencies": {
8
- "@oclif/core": "^4",
9
8
  "@types/react": "^18.3.12",
10
9
  "change-case": "^5.4.4",
11
10
  "cli-truncate": "^4.0.0",
@@ -19,6 +18,7 @@
19
18
  "devDependencies": {
20
19
  "@commitlint/config-conventional": "^19",
21
20
  "@eslint/compat": "^1.2.6",
21
+ "@oclif/core": "^4",
22
22
  "@oclif/prettier-config": "^0.2.1",
23
23
  "@oclif/test": "^4.1.8",
24
24
  "@types/chai": "^4.3.16",
@@ -26,7 +26,7 @@
26
26
  "@types/node": "^18",
27
27
  "@types/object-hash": "^3.0.6",
28
28
  "@types/sinon": "^17.0.3",
29
- "ansis": "^3.5.2",
29
+ "ansis": "^3.10.0",
30
30
  "chai": "^4.5.0",
31
31
  "commitlint": "^19",
32
32
  "eslint": "^9.19.0",