MCPcopy
hub / github.com/colbymchenry/codegraph / blankStringContents

Function blankStringContents

src/mcp/dynamic-boundaries.ts:233–259  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

231 * inside a template literal is acceptable, false-firing on prose is not.
232 */
233export function blankStringContents(text: string): string {
234 const out = text.split('');
235 let i = 0;
236 const n = text.length;
237 while (i < n) {
238 const c = text[i]!;
239 if (c === '"' || c === "'" || c === '`') {
240 const quote = c;
241 i++;
242 while (i < n && text[i] !== quote) {
243 if (text[i] === '\\' && i + 1 < n) {
244 out[i] = ' ';
245 out[i + 1] = ' ';
246 i += 2;
247 continue;
248 }
249 if (quote !== '`' && text[i] === '\n') break; // unterminated — stop blanking
250 if (text[i] !== '\n') out[i] = ' '; // keep newlines for line math
251 i++;
252 }
253 if (i < n && text[i] === quote) i++;
254 continue;
255 }
256 i++;
257 }
258 return out.join('');
259}
260
261/**
262 * Scan one symbol's body for dynamic-dispatch sites.

Callers 1

scanDynamicDispatchFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected