Skip to content

Commit 5aab68a

Browse files
committed
πŸ› fix(plugin-help): unicode length
1 parent dcf0389 commit 5aab68a

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

β€Žpackages/plugin-help/package.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"@types/text-table": "^0.2.2",
6161
"get-func-name": "^2.0.0",
6262
"picocolors": "^1.0.0",
63+
"string-width": "^5.1.2",
6364
"text-table": "^0.2.0"
6465
}
6566
}

β€Žpackages/plugin-help/src/utils.tsβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import getFuncName from "get-func-name";
22
import textTable from "text-table";
3+
import stringWidth from "string-width";
34

4-
export const table = (...items: string[][]) => textTable(items);
5+
export const table = (...items: string[][]) => textTable(items, {
6+
stringLength: stringWidth,
7+
});
58

69
export const splitTable = (...items: string[][]) => {
7-
return table(...items).toString().split("\n");
10+
return table(...items).split("\n");
811
};
912

1013
export const stringifyType = (type: any) => {

β€Žpnpm-lock.yamlβ€Ž

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)