MCPcopy
hub / github.com/codeaashu/claude-code / getMinWidth

Function getMinWidth

src/components/MarkdownTable.tsx:94–99  ·  view source on GitHub ↗
(tokens_1: Token[] | undefined)

Source from the content-addressed store, hash-verified

92
93 // Get the longest word width in a cell (minimum width to avoid breaking words)
94 function getMinWidth(tokens_1: Token[] | undefined): number {
95 const text = getPlainText(tokens_1);
96 const words = text.split(/\s+/).filter(w => w.length > 0);
97 if (words.length === 0) return MIN_COLUMN_WIDTH;
98 return Math.max(...words.map(w_0 => stringWidth(w_0)), MIN_COLUMN_WIDTH);
99 }
100
101 // Get ideal width (full content without wrapping)
102 function getIdealWidth(tokens_2: Token[] | undefined): number {

Callers 1

MarkdownTableFunction · 0.85

Calls 2

getPlainTextFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected