feat: add spice (#12)

This commit is contained in:
Charles Packer
2025-10-27 14:25:03 -07:00
committed by GitHub
parent 6f7b3bb08b
commit 938c5ae854
11 changed files with 215 additions and 34 deletions

View File

@@ -0,0 +1,12 @@
/**
* 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 function getAsciiArtWidth(asciiArt: string): number {
if (!asciiArt) {
return 0;
}
const lines = asciiArt.split("\n");
return Math.max(...lines.map((line) => line.length));
}