tty-table 4.1.6 → 4.2.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # tty-table 端子台
2
2
 
3
- [![Build Status](https://travis-ci.org/tecfu/tty-table.svg?branch=master)](https://travis-ci.org/tecfu/tty-table) [![NPM version](https://badge.fury.io/js/tty-table.svg)](http://badge.fury.io/js/tty-table) [![Coverage Status](https://coveralls.io/repos/github/tecfu/tty-table/badge.svg?branch=master)](https://coveralls.io/github/tecfu/tty-table?branch=master)
3
+ [![NPM version](https://badge.fury.io/js/tty-table.svg)](http://badge.fury.io/js/tty-table) [![Coverage Status](https://coveralls.io/repos/github/tecfu/tty-table/badge.svg?branch=master)](https://coveralls.io/github/tecfu/tty-table?branch=master)
4
4
  ---
5
5
 
6
6
  Display your data in a table using a terminal, browser, or browser console.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tty-table",
3
- "version": "4.1.6",
3
+ "version": "4.2.1",
4
4
  "description": "Node cli table",
5
5
  "main": "src/main.js",
6
6
  "types": "src/factory.d.ts",
@@ -54,17 +54,18 @@
54
54
  "homepage": "https://github.com/tecfu/tty-table",
55
55
  "dependencies": {
56
56
  "chalk": "^4.1.2",
57
- "csv": "^5.5.0",
58
- "kleur": "^4.1.4",
57
+ "csv": "^5.5.3",
58
+ "kleur": "^4.1.5",
59
59
  "smartwrap": "^2.0.2",
60
- "strip-ansi": "^6.0.0",
60
+ "strip-ansi": "^6.0.1",
61
61
  "wcwidth": "^1.0.1",
62
- "yargs": "^17.1.1"
62
+ "yargs": "^17.7.1"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@rollup/plugin-commonjs": "^11.0.2",
66
66
  "@rollup/plugin-node-resolve": "^7.1.1",
67
67
  "@rollup/plugin-replace": "^2.3.1",
68
+ "axios-error": "^1.0.4",
68
69
  "babel-core": "^6.26.3",
69
70
  "babel-preset-babili": "0.1.4",
70
71
  "babel-preset-es2015": "^6.24.1",
package/src/factory.d.ts CHANGED
@@ -28,7 +28,7 @@ declare namespace TtyTable {
28
28
  paddingRight?: number;
29
29
  paddingTop?: number;
30
30
  value: string;
31
- width: string | number;
31
+ width?: string | number;
32
32
  }
33
33
 
34
34
  export interface Options {
package/src/format.js CHANGED
@@ -274,6 +274,8 @@ module.exports.getColumnWidths = (config, rows) => {
274
274
  const totalRelativeWidths = relativeWidths.reduce((prev, current) => prev + current)
275
275
  widths = (totalRelativeWidths < totalWidth) ? relativeWidths : widths
276
276
  }
277
+ } else {
278
+ widths = widths.map(Math.floor)
277
279
  }
278
280
 
279
281
  return widths
package/src/render.js CHANGED
@@ -252,7 +252,7 @@ module.exports.buildCell = (config, elem, columnIndex, rowType, rowIndex, rowDat
252
252
 
253
253
  default:
254
254
  // elem is assumed to be a scalar
255
- cellValue = elem || ""
255
+ cellValue = elem
256
256
  }
257
257
 
258
258
  // run formatter