mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
Replace logo with custom ASCII (#958)
This commit is contained in:
parent
95e4a60a83
commit
f8a31f29aa
4 changed files with 79 additions and 25 deletions
18
packages/cli/src/ui/utils/textUtils.ts
Normal file
18
packages/cli/src/ui/utils/textUtils.ts
Normal file
|
|
@ -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));
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue