dbcat 0.0.15 → 0.0.16

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 +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbcat",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
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
@@ -80,7 +80,7 @@ export interface TableOptions {
80
80
  // Wraps a string for table display, preserving ANSI codes and Unicode widths.
81
81
  function wrapLines(str: string, maxWidth: number): string[] {
82
82
  if (typeof Bun.wrapAnsi === "function") {
83
- return Bun.wrapAnsi(str, maxWidth, { hard: true }).split("\n");
83
+ return Bun.wrapAnsi(str, maxWidth, { hard: true, trim: false }).split("\n");
84
84
  }
85
85
 
86
86
  const raw = str.split(/\n/g).join(" ");
@@ -112,12 +112,12 @@ function wrapLines(str: string, maxWidth: number): string[] {
112
112
  }
113
113
  }
114
114
  if (Bun.stringWidth(current) >= maxWidth) {
115
- lines.push(current.trim());
115
+ lines.push(current);
116
116
  current = "";
117
117
  }
118
118
  }
119
119
  if (current.length > 0) {
120
- lines.push(current.trim());
120
+ lines.push(current);
121
121
  }
122
122
 
123
123
  return lines;