MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / blankStringContents

Function blankStringContents

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

Source from the content-addressed store, hash-verified

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

Callers 1

scanDynamicDispatchFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected