MCPcopy
hub / github.com/Waishnav/devspace / append

Method append

src/process-sessions.ts:147–167  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

145 }
146
147 append(output: string): void {
148 if (!output) return;
149
150 const previousTotal = this.totalCharacters;
151 this.totalCharacters += codePointLength(output);
152
153 if (this.totalCharacters <= this.maxCharacters) {
154 this.head += output;
155 return;
156 }
157
158 const budget = splitBudget(this.maxCharacters);
159 if (previousTotal <= this.maxCharacters) {
160 const fullOutput = this.head + output;
161 this.head = takeHead(fullOutput, budget.head);
162 this.tail = takeTail(fullOutput, budget.tail);
163 return;
164 }
165
166 this.tail = takeTail(this.tail + output, budget.tail);
167 }
168
169 hasOutput(): boolean {
170 return this.totalCharacters > 0;

Callers 6

appendMethod · 0.45
renderFunction · 0.45
renderEmptyFunction · 0.45
renderSummaryBadgeFunction · 0.45
renderReviewCardFunction · 0.45

Calls 4

codePointLengthFunction · 0.85
splitBudgetFunction · 0.85
takeHeadFunction · 0.85
takeTailFunction · 0.85

Tested by

no test coverage detected