Skip to content

Commit

Permalink
chore: fix typos (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
xjccc committed May 7, 2024
1 parent 0ea32b6 commit 53cd585
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@ Elegant CLI Builder
- Smart value parsing with typecast, boolean shortcuts and unknown flag handling
- Nested sub-commands
- Lazy and Async commands
- Plugable and composable API
- Pluggable and composable API
- Auto generated usage and help

🚧 This project is under heavy development. More features are coming soon!
Expand Down
6 changes: 3 additions & 3 deletions src/_utils.ts
Expand Up @@ -8,18 +8,18 @@ export function toArray(val: any) {
}

export function formatLineColumns(lines: string[][], linePrefix = "") {
const maxLengh: number[] = [];
const maxLength: number[] = [];
for (const line of lines) {
for (const [i, element] of line.entries()) {
maxLengh[i] = Math.max(maxLengh[i] || 0, element.length);
maxLength[i] = Math.max(maxLength[i] || 0, element.length);
}
}
return lines
.map((l) =>
l
.map(
(c, i) =>
linePrefix + c[i === 0 ? "padStart" : "padEnd"](maxLengh[i]),
linePrefix + c[i === 0 ? "padStart" : "padEnd"](maxLength[i]),
)
.join(" "),
)
Expand Down

0 comments on commit 53cd585

Please sign in to comment.