diff options
| author | Miguel Solorio <[email protected]> | 2025-06-13 00:59:45 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-13 07:59:45 +0000 |
| commit | f8a31f29aaeb31b2dfab4c18d750307308245a55 (patch) | |
| tree | 4f6d2ec09ad04d691ee5c102cd9accff57c7d1a2 /packages/cli/src/ui/utils/textUtils.ts | |
| parent | 95e4a60a83dd8e710ef69f78b3b57de4b4703344 (diff) | |
Replace logo with custom ASCII (#958)
Diffstat (limited to 'packages/cli/src/ui/utils/textUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/textUtils.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/textUtils.ts b/packages/cli/src/ui/utils/textUtils.ts new file mode 100644 index 00000000..12852865 --- /dev/null +++ b/packages/cli/src/ui/utils/textUtils.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Calculates the maximum width of a multi-line ASCII art string. + * @param asciiArt The ASCII art string. + * @returns The length of the longest line in the ASCII art. + */ +export const getAsciiArtWidth = (asciiArt: string): number => { + if (!asciiArt) { + return 0; + } + const lines = asciiArt.split('\n'); + return Math.max(...lines.map((line) => line.length)); +}; |
