MCPcopy Create free account
hub / github.com/codeaashu/claude-code / wrap

Function wrap

src/buddy/CompanionSprite.tsx:28–42  ·  view source on GitHub ↗
(text: string, width: number)

Source from the content-addressed store, hash-verified

26const H = figures.heart;
27const PET_HEARTS = [` ${H} ${H} `, ` ${H} ${H} ${H} `, ` ${H} ${H} ${H} `, `${H} ${H} ${H} `, '· · · '];
28function wrap(text: string, width: number): string[] {
29 const words = text.split(' ');
30 const lines: string[] = [];
31 let cur = '';
32 for (const w of words) {
33 if (cur.length + w.length + 1 > width && cur) {
34 lines.push(cur);
35 cur = w;
36 } else {
37 cur = cur ? `${cur} ${w}` : w;
38 }
39 }
40 if (cur) lines.push(cur);
41 return lines;
42}
43function SpeechBubble(t0) {
44 const $ = _c(31);
45 const {

Callers 1

SpeechBubbleFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected