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.
- package/package.json +1 -1
- package/src/table.ts +2 -0
package/package.json
CHANGED
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
|
|