dbcat 0.0.20 → 0.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/table.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbcat",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "A simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.",
5
5
  "author": "RiskyMH",
6
6
  "license": "MIT",
package/src/table.ts CHANGED
@@ -34,6 +34,8 @@ function formatValue(value: unknown, compact = false): string {
34
34
 
35
35
  function truncate(str: string, maxWidth: number): string {
36
36
  if (typeof Bun.sliceAnsi === "function") {
37
+ // hopefully can remove this, but Bun.sliceAnsi somehow is making last char reset color if its same length
38
+ if (Bun.stringWidth(str) <= maxWidth) return str;
37
39
  return Bun.sliceAnsi(str, 0, maxWidth, "…");
38
40
  }
39
41